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:
chamikaJ
2025-06-04 11:40:23 +05:30
parent d6686d64be
commit dcdb651dd1
2 changed files with 9 additions and 2 deletions

View File

@@ -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;