From 8aa6f1142310c4eb075a07601ed9dc6b55cec5fe Mon Sep 17 00:00:00 2001 From: Caitlin Barnard Date: Thu, 12 Dec 2024 21:49:13 +0000 Subject: [PATCH] Display pay modifier object on tab content --- front_end/src/Apps/Payroll.jsx | 18 +++++++- .../EditPayroll/EditPayModifier/index.jsx | 42 ++++++++++++------- front_end/src/Components/EditPayroll/api.js | 10 +++++ front_end/src/Components/EditPayroll/types.js | 6 +++ payroll/services/payroll.py | 33 +++++++++++++++ payroll/urls.py | 5 +++ payroll/views.py | 8 ++++ 7 files changed, 106 insertions(+), 16 deletions(-) diff --git a/front_end/src/Apps/Payroll.jsx b/front_end/src/Apps/Payroll.jsx index 01f67dcf..16e97909 100644 --- a/front_end/src/Apps/Payroll.jsx +++ b/front_end/src/Apps/Payroll.jsx @@ -13,6 +13,7 @@ import EditPayModifier from "../Components/EditPayroll/EditPayModifier"; const initialPayrollState = []; const initialVacanciesState = []; +const initialPayModifiersState = []; export default function Payroll() { const [allPayroll, dispatch] = useReducer( @@ -23,6 +24,10 @@ export default function Payroll() { vacanciesReducer, initialVacanciesState, ); + const [payModifiers, dispatchPayModifiers] = useReducer( + payModifiersReducer, + initialPayModifiersState, + ); const [saveSuccess, setSaveSuccess] = useState(false); useEffect(() => { @@ -36,6 +41,9 @@ export default function Payroll() { api .getVacancyData() .then((data) => dispatchVacancies({ type: "fetched", data })); + api + .getPayModifierData() + .then((data) => dispatchPayModifiers({ type: "fetched", data })); }, []); // Computed properties @@ -116,7 +124,7 @@ export default function Payroll() { - +