refactor: improve type safety by making 'next' optional in async route handlers and updating type imports
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m27s

This commit is contained in:
2025-12-04 14:03:17 -08:00
parent 8604be4720
commit 09a608f40d
14 changed files with 35 additions and 51 deletions

View File

@@ -7,7 +7,6 @@ import { http, HttpResponse } from 'msw';
vi.unmock('./aiApiClient');
import * as aiApiClient from './aiApiClient';
import { FlyerItem } from '../types';
// 1. Mock logger to keep output clean
vi.mock('./logger', () => ({
@@ -40,7 +39,7 @@ const server = setupServer(
if (contentType?.includes('application/json')) {
try {
body = await request.json() as Record<string, unknown>;
} catch (err) { /* ignore parse error */ }
} catch { /* ignore parse error */ }
} else if (contentType?.includes('multipart/form-data')) {
try {
// This is the key part. We read the formData from the request.
@@ -53,7 +52,7 @@ const server = setupServer(
}
formDataBody._isFormData = true;
body = formDataBody;
} catch (err) { /* ignore parse error */ }
} catch { /* ignore parse error */ }
}
requestSpy({