mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-09 09:47:28 +03:00
Migrated createNewVisits action creator to RTK
This commit is contained in:
parent
d588d8d9ef
commit
7c61033bdf
1 changed files with 5 additions and 5 deletions
|
@ -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 } }),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue