import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; import { axiosRetailInstanceData } from '../AuthenicationToken/AuthenticationToken'; export const getStockNames = createAsyncThunk( 'StockPriceUpdate/getStockNames', async (data) => { if ( data?.CompId != null && data?.CompId != undefined && data?.BranchId != null && data?.BranchId != undefined && data?.AppId != null && data?.AppId != undefined ) { return await axiosRetailInstanceData.get( `/InwardPriceUpdate?Input.appId=${data?.AppId}&Input.compId=${data?.CompId}&Input.branchId=${data?.BranchId}` ); } } ); export const PutStockPrice = createAsyncThunk( 'BookingData/PutStockPrice', async (putData) => { return await axiosRetailInstanceData.put(`/InwardPriceUpdate`, putData); } ); export const bulkPriceUpdate = createAsyncThunk( 'StockPriceUpdate/bulkPriceUpdate', async (putData) => { return await axiosRetailInstanceData.put( `/priceChange`, putData ); } ); const initialState = { StockNames: [], }; const StockPriceUpdate = createSlice({ name: 'StockPriceUpdate', initialState, }); export const settingDataSelector = (state) => state.settingPage?.settingData; export default StockPriceUpdate.reducer;