Skip to content

Commit f76d803

Browse files
committed
first stab at PUT /theme
1 parent 6775a86 commit f76d803

39 files changed

+747
-111
lines changed

coderd/apidoc/docs.go

Lines changed: 63 additions & 0 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: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ func New(options *Options) *API {
798798
r.Put("/suspend", api.putSuspendUserAccount())
799799
r.Put("/activate", api.putActivateUserAccount())
800800
})
801+
r.Put("/theme", api.putUserThemePreference)
801802
r.Route("/password", func(r chi.Router) {
802803
r.Put("/", api.putUserPassword)
803804
})

coderd/database/db2sdk/db2sdk.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func User(user database.User, organizationIDs []uuid.UUID) codersdk.User {
122122
Roles: make([]codersdk.Role, 0, len(user.RBACRoles)),
123123
AvatarURL: user.AvatarURL,
124124
LoginType: codersdk.LoginType(user.LoginType),
125+
ThemePreference: user.ThemePreference,
125126
}
126127

127128
for _, roleName := range user.RBACRoles {

coderd/database/dbauthz/dbauthz.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2825,6 +2825,10 @@ func (q *querier) UpdateUserStatus(ctx context.Context, arg database.UpdateUserS
28252825
return updateWithReturn(q.log, q.auth, fetch, q.db.UpdateUserStatus)(ctx, arg)
28262826
}
28272827

2828+
func (q *querier) UpdateUserThemePreference(ctx context.Context, arg database.UpdateUserThemePreferenceParams) (database.User, error) {
2829+
panic("not implemented")
2830+
}
2831+
28282832
func (q *querier) UpdateWorkspace(ctx context.Context, arg database.UpdateWorkspaceParams) (database.Workspace, error) {
28292833
fetch := func(ctx context.Context, arg database.UpdateWorkspaceParams) (database.Workspace, error) {
28302834
return q.db.GetWorkspaceByID(ctx, arg.ID)

coderd/database/dbmem/dbmem.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6465,6 +6465,15 @@ func (q *FakeQuerier) UpdateUserStatus(_ context.Context, arg database.UpdateUse
64656465
return database.User{}, sql.ErrNoRows
64666466
}
64676467

6468+
func (q *FakeQuerier) UpdateUserThemePreference(ctx context.Context, arg database.UpdateUserThemePreferenceParams) (database.User, error) {
6469+
err := validateDatabaseType(arg)
6470+
if err != nil {
6471+
return database.User{}, err
6472+
}
6473+
6474+
panic("not implemented")
6475+
}
6476+
64686477
func (q *FakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWorkspaceParams) (database.Workspace, error) {
64696478
if err := validateDatabaseType(arg); err != nil {
64706479
return database.Workspace{}, err

coderd/database/dbmetrics/dbmetrics.go

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

coderd/database/dbmock/dbmock.go

Lines changed: 15 additions & 0 deletions
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 & 0 deletions
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: 38 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)