59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
import { axiosRetailInstanceData } from '../AuthenicationToken/AuthenticationToken';
|
|
|
|
export const getDineinType = createAsyncThunk(
|
|
'DineinForm/getDineinType',
|
|
async () => {
|
|
return await axiosRetailInstanceData.get(
|
|
`/configMaster?TypeName=Dine In Type`
|
|
);
|
|
}
|
|
);
|
|
|
|
export const getDineinTableData = createAsyncThunk(
|
|
'DineinTable/getDineinTableData',
|
|
async ({ CompId, BranchId, AppId }) => {
|
|
if (
|
|
CompId != null &&
|
|
CompId != undefined &&
|
|
BranchId != null &&
|
|
BranchId != undefined &&
|
|
AppId != null &&
|
|
AppId != undefined
|
|
) {
|
|
return await axiosRetailInstanceData.get(
|
|
`/diningTable?CompId=${CompId}&BranchId=${BranchId}&AppId=${AppId}`
|
|
);
|
|
}
|
|
}
|
|
);
|
|
|
|
export const editDineinTableData = createAsyncThunk(
|
|
'DineInTable/editDineinTableData',
|
|
async (putData) => {
|
|
return await axiosRetailInstanceData.put(`/diningTable`, putData);
|
|
}
|
|
);
|
|
|
|
export const postDineinTableData = createAsyncThunk(
|
|
'DineInTable/editDineinTableData',
|
|
async (postData) => {
|
|
return await axiosRetailInstanceData.post(`/diningTable`, postData);
|
|
}
|
|
);
|
|
|
|
export const DeleteDineinTableData = createAsyncThunk(
|
|
'DineInTable/editDineinTableData',
|
|
async (deleteData) => {
|
|
if (
|
|
deleteData?.TableId &&
|
|
deleteData?.ActiveStatus &&
|
|
deleteData?.UpdatedBy
|
|
) {
|
|
return await axiosRetailInstanceData.delete(
|
|
`/diningTable?TableId=${deleteData?.TableId}&ActiveStatus=${deleteData?.ActiveStatus}&UpdatedBy=${deleteData?.UpdatedBy}`
|
|
);
|
|
}
|
|
}
|
|
);
|