wip: colors

This commit is contained in:
Stian Fredrik Aune
2021-07-02 08:58:09 +02:00
parent b2375e5864
commit e9bfbfbec7
8 changed files with 167 additions and 19 deletions
+14
View File
@@ -80,4 +80,18 @@ func ColorPresets(r gin.IRoutes) {
return preset, nil
}))
r.DELETE("/:id", handler(func(c *gin.Context) (interface{}, error) {
preset, err := config.ColorPresetRepository().Find(ctxOf(c), intParam(c, "id"))
if err != nil {
return nil, err
}
err = config.ColorPresetRepository().Delete(ctxOf(c), &preset)
if err != nil {
return nil, err
}
return preset, nil
}))
}