wip: colors
This commit is contained in:
@@ -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
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user