From 5fc555c67c0a78318b555aea9346a8eb4ac44ad4 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Mon, 2 Feb 2026 12:10:21 +0530 Subject: [PATCH] ijust addded getStockDetailsByVariantName --- .../BookingScreen/BookingData/BookingData.js | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/Features/BookingScreen/BookingData/BookingData.js b/src/Features/BookingScreen/BookingData/BookingData.js index e3f29b2..39188e4 100644 --- a/src/Features/BookingScreen/BookingData/BookingData.js +++ b/src/Features/BookingScreen/BookingData/BookingData.js @@ -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,37 +796,34 @@ 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`, - { - params: { - CompId, - BranchId, - AppId, - ProdName, - }, - signal, // ✅ Abort works here - } - ); + const response = await axiosRetailInstanceData.get(`/productCardList`, { + params: { + CompId, + BranchId, + AppId, + 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") + builder.addCase(getProductsearch.fulfilled, (state, action) => { + console.log(action?.payload, 'mohanaacacacca'); if (action?.payload?.statusCode === 1) { state.SelectedDatas = action?.payload?.data; } else {