Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🧹
  • Loading branch information
aslilac committed Dec 12, 2023
commit 7649852489f434da84981bf602ca6804beeb9aad
4 changes: 2 additions & 2 deletions codersdk/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (c *Client) UpdateUserStatus(ctx context.Context, user string, status UserS
}

// UpdateUserThemePreference enables callers to update the user's theme preference
func (c *Client) UpdateUserThemePreference(ctx context.Context, user string, req UpdateUserProfileRequest) (User, error) {
func (c *Client) UpdateUserThemePreference(ctx context.Context, user string, req UpdateUserThemePreferenceRequest) (User, error) {
res, err := c.Request(ctx, http.MethodPut, fmt.Sprintf("/api/v2/users/%s/theme", user), req)
if err != nil {
return User{}, err
Expand All @@ -309,7 +309,7 @@ func (c *Client) UpdateUserThemePreference(ctx context.Context, user string, req

// UpdateUserPassword updates a user password.
// It calls PUT /users/{user}/password
func (c *Client) UpdateUserPassword(ctx context.Context, user string, req UpdateUserThemePreferenceRequest) error {
func (c *Client) UpdateUserPassword(ctx context.Context, user string, req UpdateUserPasswordRequest) error {
res, err := c.Request(ctx, http.MethodPut, fmt.Sprintf("/api/v2/users/%s/password", user), req)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions site/src/api/queries/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ export const updateThemePreference = (
return {
mutationFn: (req: UpdateUserThemePreferenceRequest) =>
API.updateThemePreference(userId, req),
onSuccess: () => {
onSuccess: async () => {
// Could technically invalidate more, but we only ever care about the
// `theme_preference` for the `me` query.
queryClient.invalidateQueries(meKey);
await queryClient.invalidateQueries(meKey);
},
};
};