forked from vieter-v/vieter
feat(server): added better query params to GitRepo API
This commit is contained in:
parent
7627b28bcf
commit
1e079143cd
3 changed files with 41 additions and 3 deletions
|
|
@ -12,7 +12,10 @@ fn (mut app App) get_repos() web.Result {
|
|||
return app.json(http.Status.unauthorized, new_response('Unauthorized.'))
|
||||
}
|
||||
|
||||
repos := app.db.get_git_repos()
|
||||
filter := db.filter_from_params<db.GitRepoFilter>(app.query) or {
|
||||
return app.json(http.Status.bad_request, new_response('Invalid query parameters.'))
|
||||
}
|
||||
repos := app.db.get_git_repos(filter)
|
||||
|
||||
return app.json(http.Status.ok, new_data_response(repos))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue