fix: unable to change home board in user preferences (#2011)

This commit is contained in:
Meier Lukas
2025-01-21 10:59:04 +01:00
committed by GitHub
parent 243d7e9dd4
commit 7960a4cea1

View File

@@ -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)