shoc-frontend-new/src/api
Codex Review Integration 5d53b8e810 fix(api): send multipart uploads with their Content-Type (SH-368)
The shared ky instance declared Content-Type: application/json for every
request. Ky bakes instance headers into the Request it builds, so a FormData
body left with that header, and the beforeRequest hook that deleted it ran
after the boundary had already been dropped: the multipart body went out
with no Content-Type at all. ASP.NET then cannot bind [FromForm] fields, so
the completion-doc upload (dialog and slide-over "Upload signed PDF")
returned 400 "The file field is required.", media category updates arrived
without category or workOrderVersion, and the legacy edit form post lost its
fields.

Drop the instance-wide Content-Type. Ky still sets application/json for
json bodies, and the runtime sets multipart/form-data with the boundary.

The old unit test tolerated a missing header, and ran under jsdom whose
FormData the Node Request cannot serialize. It now runs in the node
environment and requires a multipart Content-Type whose boundary matches the
body. A Pixel 7 viewport e2e covers the signed PDF upload and JPG/MP4/MOV
media upload plus categorize.
2026-09-16 13:39:20 -03:00
..
api-error.ts feat(work-orders): integrate board list, search and field patch API 2026-07-27 10:19:34 -03:00
api-paths.ts feat(work-orders): add media content API path 2026-09-08 11:30:04 -03:00
api.ts fix(api): send multipart uploads with their Content-Type (SH-368) 2026-09-16 13:39:20 -03:00
handle-api-response.ts refactor(work-orders): pass board-api governance maintainability gate 2026-07-28 09:56:27 -03:00
paginated-response-fields.ts fix(work-orders): paginate board and search without loading the full dataset (SH-165) 2026-08-24 18:38:32 -03:00
upload-form-with-progress.ts fix(work-orders): restore completion media uploads over HTTP/1.1 2026-09-07 15:19:39 -03:00