mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix: return http 204 on test notification (#16651)
This PR changes the API response for `/api/v2/notifications/test` endpoint to HTTP 204 / No Content.
This commit is contained in:
@@ -210,7 +210,7 @@ func (api *API) postTestNotification(rw http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
httpapi.Write(ctx, rw, http.StatusOK, nil)
|
||||
rw.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
// @Summary Get user notification preferences
|
||||
|
||||
@@ -200,10 +200,9 @@ func (c *Client) PostTestNotification(ctx context.Context) error {
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
return ReadBodyAsError(res)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user