Compare commits
1 Commits
514d621884
...
8c5652c230
Author | SHA1 | Date |
---|---|---|
|
8c5652c230 |
|
@ -118,11 +118,9 @@ pub fn (db &VieterDb) delete_git_repo(repo_id int) {
|
|||
|
||||
// update_git_repo updates any non-array values for a given GitRepo.
|
||||
pub fn (db &VieterDb) update_git_repo(repo_id int, params map[string]string) {
|
||||
// sql db.conn {
|
||||
// update GitRepo set repo
|
||||
//}
|
||||
mut values := []string{}
|
||||
|
||||
// TODO does this allow for SQL injection?
|
||||
$for field in GitRepo.fields {
|
||||
if field.name in params {
|
||||
// Any fields that are array types require their own update method
|
||||
|
|
|
@ -60,7 +60,6 @@ fn (mut app App) delete_repo(id int) web.Result {
|
|||
return app.json(http.Status.unauthorized, new_response('Unauthorized.'))
|
||||
}
|
||||
|
||||
// repos.delete(id)
|
||||
app.db.delete_git_repo(id)
|
||||
|
||||
return app.json(http.Status.ok, new_response('Repo removed successfully.'))
|
||||
|
|
Loading…
Reference in New Issue