clear the remaining type errors
- DiscordAccount seeded DiscordStatus without its two nullable fields. - bug-report typed reporter.name as string, but users.name is nullable; and the Discord upload wrapped a Buffer directly in a Blob. - Lucide icons take no `title` prop, so the sync spinner's tooltip moved to a wrapping span. - DesktopView cast its dynamic import to a type that included `| null`. - dock PUT cast the request body straight to string[]; it now rejects anything that is not an array of strings instead of writing it to the database. - buildZodSchema assembles a mutable record, since z.ZodRawShape is readonly in zod v4. - The dev-server proxy forwards Bun's `string | Buffer` frames through a helper that satisfies WebSocket.send without copying. bunx tsgo is now clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0041fcbd47
commit
0d67e2af26
@@ -1,5 +1,6 @@
|
||||
import { createRouter } from '../../create-router';
|
||||
import { getDockPaths, setDockPaths } from 'officerdb';
|
||||
import * as errors from '@@/custom-errors';
|
||||
|
||||
export const dockRouter = createRouter();
|
||||
|
||||
@@ -13,7 +14,11 @@ dockRouter.get('/', async (ctx) => {
|
||||
// PUT / — full replacement of dock paths array
|
||||
dockRouter.put('/', async (ctx) => {
|
||||
const userId = ctx.get('user').id;
|
||||
const paths = ctx.get('body') as string[];
|
||||
const body = ctx.get('body') as unknown;
|
||||
if (!Array.isArray(body) || body.some((p) => typeof p !== 'string')) {
|
||||
throw errors.BAD_REQUEST('Expected an array of dock paths');
|
||||
}
|
||||
const paths = body as string[];
|
||||
await setDockPaths(userId, paths);
|
||||
return ctx.json(paths);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user