shlink-web-client/src/visits/reducers/visitCreation.ts

14 lines
387 B
TypeScript
Raw Normal View History

import { createAction, PayloadAction } from '@reduxjs/toolkit';
2020-08-27 18:56:48 +03:00
import { CreateVisit } from '../types';
const CREATE_VISITS = 'shlink/visitCreation/CREATE_VISITS';
2020-08-27 18:56:48 +03:00
export type CreateVisitsAction = PayloadAction<{
createdVisits: CreateVisit[];
}>;
2020-08-27 18:56:48 +03:00
export const createNewVisits = createAction(
CREATE_VISITS,
(createdVisits: CreateVisit[]) => ({ payload: { createdVisits } }),
);