mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
get uploads working again (#3679)
I'm not sure if this was just my local install, but even after a fresh `yarn install` my upload network request was failing because no file was passed in. I don't think the `bodySerializer` part is getting run
This commit is contained in:
parent
8e8f9cce0f
commit
b11d5970f6
@ -157,6 +157,8 @@ 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: {
|
||||
@ -165,12 +167,8 @@ export const imageUploaded = createAppAsyncThunk<
|
||||
session_id,
|
||||
},
|
||||
},
|
||||
body: { file },
|
||||
bodySerializer: (body) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', body.file);
|
||||
return formData;
|
||||
},
|
||||
// @ts-ignore
|
||||
body: formData
|
||||
});
|
||||
|
||||
if (error) {
|
||||
@ -217,7 +215,7 @@ export const imageDeleted = createAppAsyncThunk<
|
||||
|
||||
type UpdateImageArg =
|
||||
paths['/api/v1/images/{image_name}']['patch']['requestBody']['content']['application/json'] &
|
||||
paths['/api/v1/images/{image_name}']['patch']['parameters']['path'];
|
||||
paths['/api/v1/images/{image_name}']['patch']['parameters']['path'];
|
||||
|
||||
type UpdateImageResponse =
|
||||
paths['/api/v1/images/{image_name}']['patch']['responses']['200']['content']['application/json'];
|
||||
|
Loading…
Reference in New Issue
Block a user