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

Commit52d3108

Browse files
committed
Self-review
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent17d27be commit52d3108

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

‎coderd/database/dbauthz/dbauthz.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3034,7 +3034,6 @@ func (q *querier) UpdateMemberRoles(ctx context.Context, arg database.UpdateMemb
30343034
}
30353035

30363036
func (q*querier)UpdateNotificationTemplateMethodByID(ctx context.Context,arg database.UpdateNotificationTemplateMethodByIDParams) (database.NotificationTemplate,error) {
3037-
// TODO: how to restrict this to admins?
30383037
iferr:=q.authorizeContext(ctx,policy.ActionUpdate,rbac.ResourceNotificationTemplate);err!=nil {
30393038
return database.NotificationTemplate{},err
30403039
}

‎coderd/database/queries.sql.go

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

‎coderd/database/queries/notifications.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,11 @@ FROM notification_preferences
146146
WHERE user_id= @user_id::uuid;
147147

148148
-- name: UpdateUserNotificationPreferences :execrows
149-
WITH new_valuesAS
150-
(SELECT UNNEST(@notification_template_ids::uuid[])AS notification_template_id,
151-
UNNEST(@disableds::bool[])AS disabled)
152149
INSERT
153150
INTO notification_preferences (user_id, notification_template_id, disabled)
154151
SELECT @user_id::uuid,new_values.notification_template_id,new_values.disabled
155-
FROM new_values
152+
FROM (SELECT UNNEST(@notification_template_ids::uuid[])AS notification_template_id,
153+
UNNEST(@disableds::bool[])AS disabled)AS new_values
156154
ON CONFLICT (user_id, notification_template_id) DOUPDATE
157155
SET disabled=EXCLUDED.disabled,
158156
updated_at=CURRENT_TIMESTAMP;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp