feat(project-finance): add action to update project-specific currency
- Introduced a new action `updateProjectFinanceCurrency` in the project finance slice to allow updating the currency for individual projects. - Updated the ProjectViewFinance component to dispatch the new action when the project currency is changed, ensuring the state reflects the selected currency.
This commit is contained in:
@@ -164,6 +164,11 @@ export const projectFinancesSlice = createSlice({
|
||||
task.show_sub_tasks = !task.show_sub_tasks;
|
||||
}
|
||||
}
|
||||
},
|
||||
updateProjectFinanceCurrency: (state, action: PayloadAction<string>) => {
|
||||
if (state.project) {
|
||||
state.project.currency = action.payload;
|
||||
}
|
||||
}
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
@@ -222,7 +227,8 @@ export const {
|
||||
updateTaskFixedCost,
|
||||
updateTaskEstimatedCost,
|
||||
updateTaskTimeLogged,
|
||||
toggleTaskExpansion
|
||||
toggleTaskExpansion,
|
||||
updateProjectFinanceCurrency
|
||||
} = projectFinancesSlice.actions;
|
||||
|
||||
export default projectFinancesSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user