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
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m27s
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user