feat(ui): update openapi-fetch; fix upload issue

My PR to fix an issue with the handling of formdata in `openapi-fetch` is released. This means we no longer need to patch the package (no patches at all now!).

This PR bumps its version and adds a transformer to our typegen script to handle typing binary form fields correctly as `Blob`.

Also regens types.
This commit is contained in:
psychedelicious
2023-07-07 16:08:30 +10:00
parent 7481508282
commit 803e1aaa17
8 changed files with 246 additions and 284 deletions

View File

@@ -157,8 +157,6 @@ export const imageUploaded = createAppAsyncThunk<
session_id,
} = arg;
const { post } = $client.get();
const formData = new FormData();
formData.append('file', file);
const { data, error, response } = await post('/api/v1/images/', {
params: {
query: {
@@ -167,10 +165,12 @@ export const imageUploaded = createAppAsyncThunk<
session_id,
},
},
// TODO: Proper handling of `multipart/form-data` is coming soon, will fix type issues
// https://github.com/drwpow/openapi-typescript/issues/1123
// @ts-ignore
body: formData,
body: { file },
bodySerializer: (body) => {
const formData = new FormData();
formData.append('file', body.file);
return formData;
},
});
if (error) {