add remaining scope repo methods.

This commit is contained in:
2022-04-16 19:24:56 +02:00
parent 11c0bd62e2
commit 5ec3d938ab
5 changed files with 278 additions and 17 deletions
+2 -2
View File
@@ -8,11 +8,11 @@ import (
)
func Scopes(g *gin.RouterGroup, db database.Database) {
g.GET("/", handler("goals", func(c *gin.Context) (interface{}, error) {
g.GET("/", handler("scopes", func(c *gin.Context) (interface{}, error) {
return db.Scopes().ListByUser(c.Request.Context(), auth.UserID(c))
}))
g.GET("/:id", handler("goals", func(c *gin.Context) (interface{}, error) {
g.GET("/:id", handler("scope", func(c *gin.Context) (interface{}, error) {
id, err := reqInt(c, "id")
if err != nil {
return nil, err