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

Commitd3ffffa

Browse files
committed
API finalization + tests
Signed-off-by: Danny Kopping <danny@coder.com>
1 parentf487c2e commitd3ffffa

File tree

11 files changed

+573
-58
lines changed

11 files changed

+573
-58
lines changed

‎coderd/apidoc/docs.go

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

‎coderd/apidoc/swagger.json

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

‎coderd/coderd.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,12 @@ func New(options *Options) *API {
10501050
})
10511051
r.Get("/gitsshkey",api.gitSSHKey)
10521052
r.Put("/gitsshkey",api.regenerateGitSSHKey)
1053+
r.Route("/notifications",func(r chi.Router) {
1054+
r.Route("/preferences",func(r chi.Router) {
1055+
r.Get("/",api.userNotificationPreferences)
1056+
r.Put("/",api.putUserNotificationPreferences)
1057+
})
1058+
})
10531059
})
10541060
})
10551061
})
@@ -1252,10 +1258,6 @@ func New(options *Options) *API {
12521258
r.Route("/templates",func(r chi.Router) {
12531259
r.Get("/system",api.systemNotificationTemplates)
12541260
})
1255-
r.Route("/preferences",func(r chi.Router) {
1256-
r.Get("/",api.userNotificationPreferences)
1257-
r.Put("/",api.putUserNotificationPreferences)
1258-
})
12591261
})
12601262
})
12611263

‎coderd/database/modelmethods.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ func (a GetOAuth2ProviderAppsByUserIDRow) RBACObject() rbac.Object {
276276
returna.OAuth2ProviderApp.RBACObject()
277277
}
278278

279+
func (nNotificationPreference)RBACObject() rbac.Object {
280+
returnrbac.ResourceNotificationPreference.WithOwner(n.UserID.String())
281+
}
282+
279283
typeWorkspaceAgentConnectionStatusstruct {
280284
StatusWorkspaceAgentStatus`json:"status"`
281285
FirstConnectedAt*time.Time`json:"first_connected_at"`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp