Merge pull request #4469 from brantsrasmus/fix/board-create-description

fix: creating a board without a description returns 500
This commit is contained in:
Mike Cao authored and GitHub committed 2026-09-10 23:07:22 -07:00
commit d0b8f95e89
2 files changed
+38

No files matched your search

+3
View File
@@ -75,6 +75,9 @@ export async function POST(request: Request) {
...body,
type: normalizeBoardType(body.type),
id: uuid(),
// The column is NOT NULL with no default, so an omitted description —
// which the request schema allows — reaches Prisma as undefined and throws.
description: body.description ?? '',
parameters: body.parameters ?? {},
userId: !teamId ? auth.user.id : undefined,
};
+35
View File
@@ -0,0 +1,35 @@
import { expect, test } from '@playwright/test';
import { type Auth, authHeaders, loginViaApi } from './helpers';
test.describe('Board API tests', () => {
test.describe.configure({ mode: 'serial' });
let auth: Auth;
let boardId = '';
test.beforeAll(async ({ request }) => {
auth = await loginViaApi(request);
});
test.afterAll(async ({ request }) => {
if (boardId) {
await request.delete(`/api/boards/${boardId}`, { headers: authHeaders(auth) });
}
});
test('creates a board without a description', async ({ request }) => {
const response = await request.post('/api/boards', {
headers: authHeaders(auth),
data: { name: 'Playwright board', type: 'mixed' },
});
expect(response.status()).toBe(200);
const body = await response.json();
boardId = body.id;
expect(body).toHaveProperty('name', 'Playwright board');
expect(body).toHaveProperty('description', '');
});
});