8000 fix: swagger · coder/coder@8b3b187 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b3b187

Browse files
committed
fix: swagger
1 parent f603ad6 commit 8b3b187

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

coderd/apidoc/docs.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/notifications.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func (api *API) notificationsSettings(rw http.ResponseWriter, r *http.Request) {
4545
httpapi.Write(r.Context(), rw, http.StatusOK, settings)
4646
}
4747

48-
// @Summary Notification settings
49-
// @ID notifications-settings
48+
// @Summary Update notifications settings
49+
// @ID update-notifications-settings
5050
// @Security CoderSessionToken
5151
// @Accept json
5252
// @Produce json
@@ -69,8 +69,7 @@ func (api *API) putNotificationsSettings(rw http.ResponseWriter, r *http.Request
6969
return
7070
}
7171

72-
/*settingsJSON*/
73-
_, err := json.Marshal(&settings)
72+
settingsJSON, err := json.Marshal(&settings)
7473
if err != nil {
7574
httpapi.Write(r.Context(), rw, http.StatusInternalServerError, codersdk.Response{
7675
Message: "Failed to marshal notifications settings.",
@@ -93,5 +92,14 @@ func (api *API) putNotificationsSettings(rw http.ResponseWriter, r *http.Request
9392
NotifierPaused: settings.NotifierPaused,
9493
}
9594

96-
// TODO
95+
err = api.Database.UpsertNotificationsSettings(ctx, string(settingsJSON))
96+
if err != nil {
97+
httpapi.Write(r.Context(), rw, http.StatusInternalServerError, codersdk.Response{
98+
Message: "Failed to update notifications settings.",
99+
Detail: err.Error(),
100+
})
101+
return
102+
}
103+
104+
httpapi.Write(r.Context(), rw, http.StatusOK, settings)
97105
}

docs/api/general.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0