ijust addded getStockDetailsByVariantName
This commit is contained in:
parent
5b0328e5bc
commit
5fc555c67c
|
|
@ -18,6 +18,15 @@ export const getNotification = createAsyncThunk(
|
|||
);
|
||||
}
|
||||
);
|
||||
export const getStockDetailsByVariantName = createAsyncThunk(
|
||||
'BookingData/getStockDetailsByVariantName',
|
||||
async (data) => {
|
||||
return await axiosRetailInstanceData.post(
|
||||
`/productVariantListByname`,
|
||||
data
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export const getLayoutCategories = createAsyncThunk(
|
||||
'BookingData/getLayoutCategories',
|
||||
|
|
@ -787,19 +796,17 @@ export const getPaymentOptionFeatureApi = createAsyncThunk(
|
|||
);
|
||||
|
||||
export const getProductsearch = createAsyncThunk(
|
||||
"BookingData/getProductsearch",
|
||||
'BookingData/getProductsearch',
|
||||
async (
|
||||
{ CompId, BranchId, AppId, ProdName },
|
||||
{ signal, rejectWithValue }
|
||||
) => {
|
||||
try {
|
||||
if (!CompId || !BranchId || !AppId || !ProdName) {
|
||||
return rejectWithValue("Invalid params");
|
||||
return rejectWithValue('Invalid params');
|
||||
}
|
||||
|
||||
const response = await axiosRetailInstanceData.get(
|
||||
`/productCardList`,
|
||||
{
|
||||
const response = await axiosRetailInstanceData.get(`/productCardList`, {
|
||||
params: {
|
||||
CompId,
|
||||
BranchId,
|
||||
|
|
@ -807,17 +814,16 @@ export const getProductsearch = createAsyncThunk(
|
|||
ProdName,
|
||||
},
|
||||
signal, // ✅ Abort works here
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return response.data; // ✅ return only data
|
||||
} catch (error) {
|
||||
// ✅ Abort error – ignore
|
||||
if (error.name === "CanceledError" || error.name === "AbortError") {
|
||||
if (error.name === 'CanceledError' || error.name === 'AbortError') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return rejectWithValue(error.response?.data || "API Error");
|
||||
return rejectWithValue(error.response?.data || 'API Error');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -1423,7 +1429,7 @@ export const getMissedOrderids = createAsyncThunk(
|
|||
export const CustomerOrderList = createAsyncThunk(
|
||||
'CustomerOrderList/LastBuyProductList',
|
||||
async (data) => {
|
||||
const { AppId, CompId, BranchId, MobileNo,FromDate,ToDate } = data;
|
||||
const { AppId, CompId, BranchId, MobileNo, FromDate, ToDate } = data;
|
||||
if (
|
||||
AppId != null &&
|
||||
AppId != undefined &&
|
||||
|
|
@ -1441,8 +1447,7 @@ export const CustomerOrderList = createAsyncThunk(
|
|||
return await axiosRetailInstanceData.get(
|
||||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}&fromDate=${FromDate}&toDate=${ToDate}`
|
||||
);
|
||||
}
|
||||
else if (
|
||||
} else if (
|
||||
AppId != null &&
|
||||
AppId != undefined &&
|
||||
CompId != null &&
|
||||
|
|
@ -1456,7 +1461,6 @@ export const CustomerOrderList = createAsyncThunk(
|
|||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}`
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -1477,8 +1481,6 @@ export const getmultipleSearch = createAsyncThunk(
|
|||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
const initialState = {
|
||||
PrintStyle: null,
|
||||
CustId: null,
|
||||
|
|
@ -1967,9 +1969,8 @@ const BookingData = createSlice({
|
|||
state.SelectedDatas = [];
|
||||
}
|
||||
}),
|
||||
|
||||
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
||||
console.log(action?.payload,"mohanaacacacca")
|
||||
console.log(action?.payload, 'mohanaacacacca');
|
||||
if (action?.payload?.statusCode === 1) {
|
||||
state.SelectedDatas = action?.payload?.data;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue