feat: add button to remove image from class

This commit is contained in:
2024-04-13 00:38:36 +01:00
parent eb20c1b0ac
commit 3f828ab855
4 changed files with 62 additions and 8 deletions

View File

@@ -95,6 +95,16 @@ func (x *Handle) Delete(path string, fn func(c *Context) *Error) {
x.deletes = append(x.deletes, HandleFunc{path, fn})
}
func (x *Handle) DeleteAuth(path string, authLevel int, fn func(c *Context) *Error) {
inner_fn := func(c *Context) *Error {
if !c.CheckAuthLevel(authLevel) {
return nil
}
return fn(c)
}
x.posts = append(x.posts, HandleFunc{path, inner_fn})
}
func (x *Handle) handleGets(context *Context) {
defer func() {
if r := recover(); r != nil {

View File

@@ -204,7 +204,7 @@ func MyParseForm(r *http.Request) (vs url.Values, err error) {
return
}
type JustId struct{ Id string }
type JustId struct{ Id string `json:"id" validate:"required"` }
type Generic struct{ reflect.Type }