mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
fix: unable to change home board in user preferences (#2011)
This commit is contained in:
@@ -404,7 +404,13 @@ export const userRouter = createTRPCRouter({
|
||||
});
|
||||
}
|
||||
|
||||
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.userId), "view");
|
||||
// Only allow user to select boards they have access to
|
||||
if (input.homeBoardId) {
|
||||
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.homeBoardId), "view");
|
||||
}
|
||||
if (input.mobileHomeBoardId) {
|
||||
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.mobileHomeBoardId), "view");
|
||||
}
|
||||
|
||||
await ctx.db
|
||||
.update(users)
|
||||
|
||||
Reference in New Issue
Block a user