fix: TypeScript type mismatch between UspsValidationResult and local fallback object
SonarQube Analysis / sonarqube (pull_request) Successful in 3m12s
Tests / backend-unit (pull_request) Successful in 57s
Tests / backend-integration (pull_request) Failing after 1m7s
Tests / frontend-e2e (pull_request) Failing after 38s

This commit is contained in:
2026-08-14 14:47:52 -05:00
parent 4f055a2fcd
commit b73b472d80
+3 -3
View File
@@ -1,7 +1,7 @@
import { Router, Request, Response } from 'express'; import { Router, Request, Response } from 'express';
import { pool } from '../db'; import { pool } from '../db';
import { requireCustomer } from '../middleware/customerAuth'; import { requireCustomer } from '../middleware/customerAuth';
import { validateAddress, uspsConfigured } from '../usps'; import { validateAddress, uspsConfigured, UspsValidationResult } from '../usps';
const router = Router(); const router = Router();
@@ -19,8 +19,8 @@ router.post('/', requireCustomer, async (req: Request, res: Response) => {
return res.status(400).json({ error: 'fullName, addressLine1, city, state, and postalCode are required' }); return res.status(400).json({ error: 'fullName, addressLine1, city, state, and postalCode are required' });
} }
let uspsResult = { validated: false, deliverable: null as boolean | null, standardized: null as Record<string, unknown> | null, reason: undefined as string | undefined }; let uspsResult: UspsValidationResult = { validated: false, deliverable: null, standardized: null };
if ((country || 'US') === 'US') { if ((country || 'US') === 'US') {
uspsResult = await validateAddress({ addressLine1, addressLine2, city, state, postalCode }); uspsResult = await validateAddress({ addressLine1, addressLine2, city, state, postalCode });
} }