aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context/base.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/base.go')
-rw-r--r--modules/context/base.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/context/base.go b/modules/context/base.go
index 45f33feb08..839f3e10df 100644
--- a/modules/context/base.go
+++ b/modules/context/base.go
@@ -140,6 +140,10 @@ func (b *Base) JSONRedirect(redirect string) {
b.JSON(http.StatusOK, map[string]any{"redirect": redirect})
}
+func (b *Base) JSONOK() {
+ b.JSON(http.StatusOK, map[string]any{"ok": true}) // this is only a dummy response, frontend seldom uses it
+}
+
func (b *Base) JSONError(msg string) {
b.JSON(http.StatusBadRequest, map[string]any{"errorMessage": msg})
}