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