fix(boards): add permissions to board summary schema to fix manage page crash (#5917)

* fix(boards): add permissions to board summary schema to fix manage page crash

The getAllBoards query fetches userPermissions and groupPermissions
from the DB, but boardSummarySchema (the output validator) did not
include them. tRPC stripped the fields, causing a TypeError when
getBoardPermissionsAsync called .some() on undefined.

* fix(backup): cast Buffer to Uint8Array for NextResponse body

Node 24 narrowed the BodyInit type, making Buffer incompatible.
Wrapping in Uint8Array satisfies the type constraint.

* fix(lint): remove forbidden non-null assertions across backup and board code

Replace non-null assertions with safe guards, optional chaining, and
for-of iteration so oxlint passes in CI. Also remove unused Collapse import.
This commit is contained in:
Thomas authored and GitHub committed 2026-06-10 19:51:56 +02:00
1 parent f26007a29a
commit a42af0e678
8 files changed
+34 -19

No files matched your search

+6 -2
View File
@@ -1430,8 +1430,10 @@ export const boardRouter = createTRPCRouter({
for (const il of existingInSection) {
for (let y = il.yOffset; y < il.yOffset + il.height; y++) {
while (occupied.length <= y) occupied.push(Array.from<boolean>({ length: layout.columnCount }).fill(false));
const occupiedRow = occupied[y];
if (!occupiedRow) continue;
for (let x = il.xOffset; x < il.xOffset + il.width; x++) {
occupied[y]![x] = true;
occupiedRow[x] = true;
}
}
}
@@ -1439,8 +1441,10 @@ export const boardRouter = createTRPCRouter({
let placed = false;
for (let y = 0; y < 9999 && !placed; y++) {
if (!occupied[y]) occupied.push(Array.from<boolean>({ length: layout.columnCount }).fill(false));
const occupiedRow = occupied[y];
if (!occupiedRow) continue;
for (let x = 0; x < layout.columnCount && !placed; x++) {
if (!occupied[y]![x]) {
if (!occupiedRow[x]) {
layoutRows.push({
itemId,
sectionId: emptySection.id,