diff options
author | NorthRealm <155140859+NorthRealm@users.noreply.github.com> | 2025-05-14 03:18:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-13 19:18:13 +0000 |
commit | 1e2f3514b9afd903e19a0413e5d925515e13abf8 (patch) | |
tree | 06d49490775b5c8e5983e6d65ddf837932ded952 /services/context/api.go | |
parent | a0595add72db4a5fb421579b9c6bb7dae1392c86 (diff) | |
download | gitea-1e2f3514b9afd903e19a0413e5d925515e13abf8.tar.gz gitea-1e2f3514b9afd903e19a0413e5d925515e13abf8.zip |
Add endpoint deleting workflow run (#34337)
Add endpoint deleting workflow run
Resolves #26219
/claim #26219
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/context/api.go')
-rw-r--r-- | services/context/api.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/context/api.go b/services/context/api.go index d43e15bf24..28f0e43d88 100644 --- a/services/context/api.go +++ b/services/context/api.go @@ -245,7 +245,7 @@ func APIContexter() func(http.Handler) http.Handler { // APIErrorNotFound handles 404s for APIContext // String will replace message, errors will be added to a slice func (ctx *APIContext) APIErrorNotFound(objs ...any) { - message := ctx.Locale.TrString("error.not_found") + var message string var errs []string for _, obj := range objs { // Ignore nil @@ -259,9 +259,8 @@ func (ctx *APIContext) APIErrorNotFound(objs ...any) { message = obj.(string) } } - ctx.JSON(http.StatusNotFound, map[string]any{ - "message": message, + "message": util.IfZero(message, "not found"), // do not use locale in API "url": setting.API.SwaggerURL, "errors": errs, }) |