mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
Merge pull request #739 from acelaya-forks/feature/rtk-errors
Changed how errors are serialized by async thunks
This commit is contained in:
commit
ee7a091586
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,12 @@
|
||||||
import { createAsyncThunk as baseCreateAsyncThunk, AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
|
import { createAsyncThunk as baseCreateAsyncThunk, AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
|
||||||
|
import { identity } from 'ramda';
|
||||||
import { ShlinkState } from '../../container/types';
|
import { ShlinkState } from '../../container/types';
|
||||||
|
|
||||||
export const createAsyncThunk = <Returned, ThunkArg>(
|
export const createAsyncThunk = <Returned, ThunkArg>(
|
||||||
typePrefix: string,
|
typePrefix: string,
|
||||||
payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, { state: ShlinkState }>,
|
payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, { state: ShlinkState, serializedErrorType: any }>,
|
||||||
) => baseCreateAsyncThunk(typePrefix, payloadCreator);
|
) => baseCreateAsyncThunk(
|
||||||
|
typePrefix,
|
||||||
|
payloadCreator,
|
||||||
|
{ serializeError: identity },
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue