Skip to content

Commit 76804ad

Browse files
committed
🧹🧹
1 parent 1c6f7fe commit 76804ad

File tree

8 files changed

+11
-10
lines changed

8 files changed

+11
-10
lines changed

coderd/coderd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ func New(options *Options) *API {
11241124
r.Put("/suspend", api.putSuspendUserAccount())
11251125
r.Put("/activate", api.putActivateUserAccount())
11261126
})
1127-
r.Get("/appearance", api.getUserAppearanceSettings)
1127+
r.Get("/appearance", api.userAppearanceSettings)
11281128
r.Put("/appearance", api.putUserAppearanceSettings)
11291129
r.Route("/password", func(r chi.Router) {
11301130
r.Use(httpmw.RateLimit(options.LoginRateLimit, time.Minute))

coderd/database/dump.sql

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/foreign_key_constraint.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000293_user_configs.up.sql

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ CREATE TABLE IF NOT EXISTS user_configs (
77
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
88
);
99

10-
ALTER TABLE ONLY user_configs
11-
ADD CONSTRAINT unique_key_per_user UNIQUE (user_id, key);
1210

13-
14-
--
11+
-- Copy "theme_preference" from "users" table
1512
INSERT INTO user_configs (user_id, key, value)
1613
SELECT id, 'theme_preference', theme_preference
1714
FROM users

coderd/database/queries.sql.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/users.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ INSERT INTO
113113
VALUES
114114
(@user_id, 'theme_preference', @theme_preference)
115115
ON CONFLICT
116-
ON CONSTRAINT unique_key_per_user
116+
ON CONSTRAINT user_configs_pkey
117117
DO UPDATE
118118
SET
119119
value = @theme_preference

coderd/database/unique_constraint.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/users.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ func (api *API) notifyUserStatusChanged(ctx context.Context, actingUserName stri
982982
// @Param user path string true "User ID, name, or me"
983983
// @Success 200 {object} codersdk.UserAppearanceSettings
984984
// @Router /users/{user}/appearance [get]
985-
func (api *API) getUserAppearanceSettings(rw http.ResponseWriter, r *http.Request) {
985+
func (api *API) userAppearanceSettings(rw http.ResponseWriter, r *http.Request) {
986986
var (
987987
ctx = r.Context()
988988
user = httpmw.UserParam(r)

0 commit comments

Comments
 (0)