|
@@ -204,6 +204,7 @@ const aprSlice = createSlice({
|
|
|
});
|
|
|
|
|
|
const aprMiddleware: Middleware = (store) => (next) => (action: any) => {
|
|
|
+ const result = next(action);
|
|
|
if (
|
|
|
action.type === aprSlice.actions.setBodysize.type ||
|
|
|
action.type === aprSlice.actions.setWorkstation.type
|
|
@@ -212,13 +213,16 @@ const aprMiddleware: Middleware = (store) => (next) => (action: any) => {
|
|
|
const state = store.getState();
|
|
|
const id =
|
|
|
state.bodyPositionList.selectedBodyPosition?.view_id || 'default_id'; // Dynamically determined based on selectedBodyPosition
|
|
|
- const workStationId = workstationIdFromWorkstation(state.apr.workstation);
|
|
|
+ const workStationId = workstationIdFromWorkstation(
|
|
|
+ state.apr.workstation,
|
|
|
+ state.product.productName
|
|
|
+ );
|
|
|
const patientSize = state.apr.bodysize;
|
|
|
console.log(
|
|
|
`Fetching APR exposure parameters for ID: ${id}, Workstation ID: ${workStationId}, Patient Size: ${patientSize}`
|
|
|
);
|
|
|
// Fetch APR exposure parameters based on the current state
|
|
|
- if (!!patientSize && workStationId !== 0) {
|
|
|
+ if (!!patientSize) {
|
|
|
getAprExposureParams(id, workStationId, patientSize)
|
|
|
.then((data) => {
|
|
|
console.log('Received APR exposure parameters:', data);
|
|
@@ -235,7 +239,7 @@ const aprMiddleware: Middleware = (store) => (next) => (action: any) => {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- return next(action);
|
|
|
+ return result;
|
|
|
};
|
|
|
|
|
|
export const incKV = createAsyncThunk<number, number>('apr/incKV', async (amount: number) => {
|