Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98c6e64

Browse files
mtojekaslilac
authored andcommitted
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.
1 parentfd68a63 commit98c6e64

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

‎coderd/notifications.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (api *API) postTestNotification(rw http.ResponseWriter, r *http.Request) {
210210
return
211211
}
212212

213-
httpapi.Write(ctx,rw,http.StatusOK,nil)
213+
rw.WriteHeader(http.StatusNoContent)
214214
}
215215

216216
// @Summary Get user notification preferences

‎codersdk/notifications.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,9 @@ func (c *Client) PostTestNotification(ctx context.Context) error {
200200
}
201201
deferres.Body.Close()
202202

203-
ifres.StatusCode!=http.StatusOK {
203+
ifres.StatusCode!=http.StatusNoContent {
204204
returnReadBodyAsError(res)
205205
}
206-
207206
returnnil
208207
}
209208

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp