Merge pull request '[API] Add error messages to dispatch API' (#4768) from gusted/forgejo-fix-dispatch-api-error into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4768
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-07-31 21:04:01 +00:00
commit 6bb541e0d0

View file

@ -621,10 +621,10 @@ func DispatchWorkflow(ctx *context.APIContext) {
name := ctx.Params("workflowname")
if len(opt.Ref) == 0 {
ctx.Error(http.StatusBadRequest, "ref", nil)
ctx.Error(http.StatusBadRequest, "ref", "ref is empty")
return
} else if len(name) == 0 {
ctx.Error(http.StatusBadRequest, "workflowname", nil)
ctx.Error(http.StatusBadRequest, "workflowname", "workflow name is empty")
return
}