diff --git a/invokeai/frontend/web/src/services/api/thunks/image.ts b/invokeai/frontend/web/src/services/api/thunks/image.ts index bff13659ac..4f7cf74b30 100644 --- a/invokeai/frontend/web/src/services/api/thunks/image.ts +++ b/invokeai/frontend/web/src/services/api/thunks/image.ts @@ -38,7 +38,7 @@ export const imageUrlsReceived = createAppAsyncThunk< } ); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } @@ -73,7 +73,7 @@ export const imageMetadataReceived = createAppAsyncThunk< } ); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } @@ -163,10 +163,11 @@ export const imageUploaded = createAppAsyncThunk< }, // 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, }); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } @@ -202,11 +203,9 @@ export const imageDeleted = createAppAsyncThunk< }, }); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } - - return data; }); type UpdateImageArg = @@ -244,7 +243,7 @@ export const imageUpdated = createAppAsyncThunk< }, }); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } @@ -313,7 +312,7 @@ export const receivedPageOfImages = createAppAsyncThunk< }, }); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } diff --git a/invokeai/frontend/web/src/services/api/thunks/session.ts b/invokeai/frontend/web/src/services/api/thunks/session.ts index 89f008a610..a60238e2d5 100644 --- a/invokeai/frontend/web/src/services/api/thunks/session.ts +++ b/invokeai/frontend/web/src/services/api/thunks/session.ts @@ -41,7 +41,7 @@ export const sessionCreated = createAppAsyncThunk< body: graph, }); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } @@ -81,14 +81,12 @@ export const sessionInvoked = createAppAsyncThunk< } ); - if (error || !data) { + if (error) { if (isErrorWithStatus(error) && error.status === 403) { return rejectWithValue({ arg, error: (error as any).body.detail }); } return rejectWithValue({ arg, error }); } - - return data; }); type CancelSessionArg = @@ -123,7 +121,7 @@ export const sessionCanceled = createAppAsyncThunk< } ); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); } @@ -157,7 +155,7 @@ export const listedSessions = createAppAsyncThunk< params, }); - if (error || !data) { + if (error) { return rejectWithValue({ arg, error }); }