Merge pull request 'FIX #44 : Added the missing getStockDetailsByVariantName function.' (#49) from bug/lastpurchasedOrder into main
Reviewed-on: Pozomind/pozo-retail-app#49
This commit is contained in:
commit
4972cc4846
|
|
@ -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(
|
export const getLayoutCategories = createAsyncThunk(
|
||||||
'BookingData/getLayoutCategories',
|
'BookingData/getLayoutCategories',
|
||||||
|
|
@ -787,19 +796,17 @@ export const getPaymentOptionFeatureApi = createAsyncThunk(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getProductsearch = createAsyncThunk(
|
export const getProductsearch = createAsyncThunk(
|
||||||
"BookingData/getProductsearch",
|
'BookingData/getProductsearch',
|
||||||
async (
|
async (
|
||||||
{ CompId, BranchId, AppId, ProdName },
|
{ CompId, BranchId, AppId, ProdName },
|
||||||
{ signal, rejectWithValue }
|
{ signal, rejectWithValue }
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
if (!CompId || !BranchId || !AppId || !ProdName) {
|
if (!CompId || !BranchId || !AppId || !ProdName) {
|
||||||
return rejectWithValue("Invalid params");
|
return rejectWithValue('Invalid params');
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await axiosRetailInstanceData.get(
|
const response = await axiosRetailInstanceData.get(`/productCardList`, {
|
||||||
`/productCardList`,
|
|
||||||
{
|
|
||||||
params: {
|
params: {
|
||||||
CompId,
|
CompId,
|
||||||
BranchId,
|
BranchId,
|
||||||
|
|
@ -807,17 +814,16 @@ export const getProductsearch = createAsyncThunk(
|
||||||
ProdName,
|
ProdName,
|
||||||
},
|
},
|
||||||
signal, // ✅ Abort works here
|
signal, // ✅ Abort works here
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
return response.data; // ✅ return only data
|
return response.data; // ✅ return only data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// ✅ Abort error – ignore
|
// ✅ Abort error – ignore
|
||||||
if (error.name === "CanceledError" || error.name === "AbortError") {
|
if (error.name === 'CanceledError' || error.name === 'AbortError') {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rejectWithValue(error.response?.data || "API Error");
|
return rejectWithValue(error.response?.data || 'API Error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -1441,8 +1447,7 @@ export const CustomerOrderList = createAsyncThunk(
|
||||||
return await axiosRetailInstanceData.get(
|
return await axiosRetailInstanceData.get(
|
||||||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}&fromDate=${FromDate}&toDate=${ToDate}`
|
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}&fromDate=${FromDate}&toDate=${ToDate}`
|
||||||
);
|
);
|
||||||
}
|
} else if (
|
||||||
else if (
|
|
||||||
AppId != null &&
|
AppId != null &&
|
||||||
AppId != undefined &&
|
AppId != undefined &&
|
||||||
CompId != null &&
|
CompId != null &&
|
||||||
|
|
@ -1456,7 +1461,6 @@ export const CustomerOrderList = createAsyncThunk(
|
||||||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}`
|
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -1477,8 +1481,6 @@ export const getmultipleSearch = createAsyncThunk(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
PrintStyle: null,
|
PrintStyle: null,
|
||||||
CustId: null,
|
CustId: null,
|
||||||
|
|
@ -1967,9 +1969,8 @@ const BookingData = createSlice({
|
||||||
state.SelectedDatas = [];
|
state.SelectedDatas = [];
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
||||||
console.log(action?.payload,"mohanaacacacca")
|
console.log(action?.payload, 'mohanaacacacca');
|
||||||
if (action?.payload?.statusCode === 1) {
|
if (action?.payload?.statusCode === 1) {
|
||||||
state.SelectedDatas = action?.payload?.data;
|
state.SelectedDatas = action?.payload?.data;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue