Create admin settings and moved signup disable setting there

This commit is contained in:
Thomas Miceli
2023-04-17 00:17:06 +02:00
parent dbdd38694d
commit dba3f4be44
10 changed files with 127 additions and 16 deletions

View File

@ -182,3 +182,16 @@ func adminSyncReposFromDB(ctx echo.Context) error {
}()
return redirect(ctx, "/admin-panel")
}
func adminSetSetting(ctx echo.Context) error {
key := ctx.FormValue("key")
value := ctx.FormValue("value")
if err := models.UpdateSetting(key, value); err != nil {
return errorRes(500, "Cannot set setting", err)
}
return ctx.JSON(200, map[string]interface{}{
"success": true,
})
}