mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-17 07:44:10 -05:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user