mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 12:43:13 +00:00
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. |
||
|---|---|---|
| .. | ||
| api-error.ts | ||
| api-paths.ts | ||
| api.ts | ||
| handle-api-response.ts | ||
| paginated-response-fields.ts | ||
| upload-form-with-progress.ts | ||