Android_Retail/src/Features/StockPriceUpdate/StockPriceUpdateMaster.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-01-27 18:27:29 +05:30
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;