2022-11-05 15:01:00 +03:00
|
|
|
import { PayloadAction } from '@reduxjs/toolkit';
|
2020-08-27 18:56:48 +03:00
|
|
|
import { CreateVisit } from '../types';
|
|
|
|
|
2020-09-12 12:31:44 +03:00
|
|
|
export const CREATE_VISITS = 'shlink/visitCreation/CREATE_VISITS';
|
2020-08-27 18:56:48 +03:00
|
|
|
|
2022-11-05 15:01:00 +03:00
|
|
|
export type CreateVisitsAction = PayloadAction<{
|
2020-09-12 12:31:44 +03:00
|
|
|
createdVisits: CreateVisit[];
|
2022-11-05 15:01:00 +03:00
|
|
|
}>;
|
2020-08-27 18:56:48 +03:00
|
|
|
|
2020-09-12 12:31:44 +03:00
|
|
|
export const createNewVisits = (createdVisits: CreateVisit[]): CreateVisitsAction => ({
|
|
|
|
type: CREATE_VISITS,
|
2022-11-05 15:01:00 +03:00
|
|
|
payload: { createdVisits },
|
2020-08-27 18:56:48 +03:00
|
|
|
});
|