Add terminations to error repsonses in API. (#1872)

This commit is contained in:
funkyhippo
2022-04-23 15:19:17 -05:00
committed by GitHub
parent c0aea77fe4
commit a500a5f975
3 changed files with 5 additions and 0 deletions

View File

@@ -626,6 +626,7 @@ func SetExternalActions(w http.ResponseWriter, r *http.Request) {
if err := data.SetExternalActions(actions.Value); err != nil {
controllers.WriteSimpleResponse(w, false, "unable to update external actions with provided values")
return
}
controllers.WriteSimpleResponse(w, true, "external actions update")
@@ -662,6 +663,7 @@ func SetForbiddenUsernameList(w http.ResponseWriter, r *http.Request) {
if err := data.SetForbiddenUsernameList(request.Value); err != nil {
controllers.WriteSimpleResponse(w, false, err.Error())
return
}
controllers.WriteSimpleResponse(w, true, "forbidden username list updated")
@@ -683,6 +685,7 @@ func SetSuggestedUsernameList(w http.ResponseWriter, r *http.Request) {
if err := data.SetSuggestedUsernamesList(request.Value); err != nil {
controllers.WriteSimpleResponse(w, false, err.Error())
return
}
controllers.WriteSimpleResponse(w, true, "suggested username list updated")