From 7add83f9856f2dd3d85a161b2df475e75f73458c Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 13 Nov 2022 18:26:35 +0100 Subject: [PATCH] Changed how errors are serialized by async thunks --- src/utils/helpers/redux.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/helpers/redux.ts b/src/utils/helpers/redux.ts index f55518a9..69309bf9 100644 --- a/src/utils/helpers/redux.ts +++ b/src/utils/helpers/redux.ts @@ -1,7 +1,12 @@ import { createAsyncThunk as baseCreateAsyncThunk, AsyncThunkPayloadCreator } from '@reduxjs/toolkit'; +import { identity } from 'ramda'; import { ShlinkState } from '../../container/types'; export const createAsyncThunk = ( typePrefix: string, - payloadCreator: AsyncThunkPayloadCreator, -) => baseCreateAsyncThunk(typePrefix, payloadCreator); + payloadCreator: AsyncThunkPayloadCreator, +) => baseCreateAsyncThunk( + typePrefix, + payloadCreator, + { serializeError: identity }, + );