From 7c61033bdf8f111bcedc08df6556d4e67195e3ef Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 5 Nov 2022 13:05:44 +0100 Subject: [PATCH] Migrated createNewVisits action creator to RTK --- src/visits/reducers/visitCreation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/visits/reducers/visitCreation.ts b/src/visits/reducers/visitCreation.ts index 9400c02f..a14a339a 100644 --- a/src/visits/reducers/visitCreation.ts +++ b/src/visits/reducers/visitCreation.ts @@ -1,4 +1,4 @@ -import { PayloadAction } from '@reduxjs/toolkit'; +import { createAction, PayloadAction } from '@reduxjs/toolkit'; import { CreateVisit } from '../types'; export const CREATE_VISITS = 'shlink/visitCreation/CREATE_VISITS'; @@ -7,7 +7,7 @@ export type CreateVisitsAction = PayloadAction<{ createdVisits: CreateVisit[]; }>; -export const createNewVisits = (createdVisits: CreateVisit[]): CreateVisitsAction => ({ - type: CREATE_VISITS, - payload: { createdVisits }, -}); +export const createNewVisits = createAction( + CREATE_VISITS, + (createdVisits: CreateVisit[]) => ({ payload: { createdVisits } }), +);