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

Commitfbe7a01

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

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
@@ -290,6 +290,10 @@ func (a GetOAuth2ProviderAppsByUserIDRow) RBACObject() rbac.Object {
290290
returna.OAuth2ProviderApp.RBACObject()
291291
}
292292

293+
func (nNotificationPreference)RBACObject() rbac.Object {
294+
returnrbac.ResourceNotificationPreference.WithOwner(n.UserID.String())
295+
}
296+
293297
typeWorkspaceAgentConnectionStatusstruct {
294298
StatusWorkspaceAgentStatus`json:"status"`
295299
FirstConnectedAt*time.Time`json:"first_connected_at"`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp