forked from vieter-v/vieter
				
			Ran vfmt
							parent
							
								
									148ec3ab47
								
							
						
					
					
						commit
						3a6effad80
					
				| 
						 | 
					@ -41,7 +41,6 @@ fn repo_from_params(params map[string]string) ?GitRepo {
 | 
				
			||||||
			return error('Missing parameter: ${field.name}.')
 | 
								return error('Missing parameter: ${field.name}.')
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	repo.patch_from_params(params)
 | 
						repo.patch_from_params(params)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return repo
 | 
						return repo
 | 
				
			||||||
| 
						 | 
					@ -146,7 +145,9 @@ fn (mut app App) post_repo() web.Result {
 | 
				
			||||||
	repos[id] = new_repo
 | 
						repos[id] = new_repo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lock app.git_mutex {
 | 
						lock app.git_mutex {
 | 
				
			||||||
		write_repos(app.conf.repos_file, &repos) or { return app.status(http.Status.internal_server_error) }
 | 
							write_repos(app.conf.repos_file, &repos) or {
 | 
				
			||||||
 | 
								return app.status(http.Status.internal_server_error)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return app.json(http.Status.ok, new_response('Repo added successfully.'))
 | 
						return app.json(http.Status.ok, new_response('Repo added successfully.'))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,13 +8,13 @@ struct Response<T> {
 | 
				
			||||||
fn new_response(message string) Response<string> {
 | 
					fn new_response(message string) Response<string> {
 | 
				
			||||||
	return Response<string>{
 | 
						return Response<string>{
 | 
				
			||||||
		message: message
 | 
							message: message
 | 
				
			||||||
		data: ""
 | 
							data: ''
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn new_data_response<T>(data T) Response<T> {
 | 
					fn new_data_response<T>(data T) Response<T> {
 | 
				
			||||||
	return Response<T>{
 | 
						return Response<T>{
 | 
				
			||||||
		message: ""
 | 
							message: ''
 | 
				
			||||||
		data: data
 | 
							data: data
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue