Skip to content

Commit 201fe07

Browse files
committed
fix generated
1 parent 7c0e847 commit 201fe07

File tree

6 files changed

+35
-4
lines changed

6 files changed

+35
-4
lines changed

coderd/database/models.go

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

coderd/database/querier.go

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

coderd/database/queries.sql.go

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

coderd/notifications.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"encoding/json"
55
"net/http"
66

7+
"github.com/coder/coder/v2/coderd/audit"
8+
"github.com/coder/coder/v2/coderd/database"
79
"github.com/coder/coder/v2/coderd/httpapi"
810
"github.com/coder/coder/v2/coderd/rbac"
911
"github.com/coder/coder/v2/coderd/rbac/policy"
@@ -60,4 +62,27 @@ func (api *API) putNotificationsSettings(rw http.ResponseWriter, r *http.Request
6062
return
6163
}
6264

65+
var settings codersdk.NotificationsSettings
66+
if !httpapi.Read(ctx, rw, r, &settings) {
67+
return
68+
}
69+
70+
settingsJSON, err := json.Marshal(&settings)
71+
if err != nil {
72+
httpapi.Write(r.Context(), rw, http.StatusInternalServerError, codersdk.Response{
73+
Message: "Failed to marshal notifications settings.",
74+
Detail: err.Error(),
75+
})
76+
return
77+
}
78+
79+
auditor := api.Auditor.Load()
80+
aReq, commitAudit := audit.InitRequest[database.HealthSettings](rw, &audit.RequestParams{
81+
Audit: *auditor,
82+
Log: api.Logger,
83+
Request: r,
84+
Action: database.AuditActionWrite,
85+
})
86+
defer commitAudit()
87+
6388
}

coderd/notifications/manager_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/coder/serpent"
1110
"github.com/google/uuid"
1211
"github.com/stretchr/testify/assert"
1312
"github.com/stretchr/testify/require"
1413
"golang.org/x/xerrors"
1514

15+
"github.com/coder/serpent"
16+
1617
"cdr.dev/slog"
1718
"cdr.dev/slog/sloggers/slogtest"
1819

site/src/api/typesGenerated.ts

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

0 commit comments

Comments
 (0)