From ea3fe79c8e3dadb4d0b55a7fe4820cd666b56730 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Salazar?=
<73718835+joshrs23@users.noreply.github.com>
Date: Mon, 15 Dec 2025 17:26:22 -0500
Subject: [PATCH] modification just for test staff crud
---
.../src/components/staff/StaffForm.jsx | 154 +++++++++---------
frontend-web-free/src/pages/EditStaff.jsx | 4 +
2 files changed, 81 insertions(+), 77 deletions(-)
diff --git a/frontend-web-free/src/components/staff/StaffForm.jsx b/frontend-web-free/src/components/staff/StaffForm.jsx
index 26c0608f..1cd086a5 100644
--- a/frontend-web-free/src/components/staff/StaffForm.jsx
+++ b/frontend-web-free/src/components/staff/StaffForm.jsx
@@ -14,35 +14,35 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
employee_name: "",
manager: "",
contact_number: "",
- phone: "",
+ //phone: "",
email: "", // Added email field
department: "",
hub_location: "",
- event_location: "",
+ //event_location: "",
track: "",
- address: "",
- city: "",
+ //address: "",
+ //city: "",
position: "",
- position_2: "",
- initial: "",
+ //position_2: "",
+ //initial: "",
profile_type: "",
employment_type: "",
english: "",
- english_required: false,
- check_in: "",
- replaced_by: "",
- ro: "",
- mon: "",
- schedule_days: "",
- invoiced: false,
- action: "",
+ //english_required: false,
+ //check_in: "",
+ //replaced_by: "",
+ //ro: "",
+ //mon: "",
+ //schedule_days: "",
+ //invoiced: false,
+ //action: "",
notes: "",
- accounting_comments: "",
+ //accounting_comments: "",
rating: 0,
- shift_coverage_percentage: 100,
- cancellation_count: 0,
- no_show_count: 0, // Added no_show_count field
- total_shifts: 0,
+ //shift_coverage_percentage: 100,
+ //cancellation_count: 0,
+ //no_show_count: 0, // Added no_show_count field
+ //total_shifts: 0,
reliability_score: 100
});
@@ -81,7 +81,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
-
*/}
Primary Skill
@@ -103,7 +103,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
-
+ {/*
Secondary Skill
-
+
*/}
Skill Level
@@ -121,9 +121,9 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
- Skilled
- Beginner
- Cross-Trained
+ Skilled
+ Beginner
+ Cross-Trained
@@ -135,13 +135,13 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
- Full Time
- Part Time
- On call
- Weekends
- Specific Days
- Seasonal
- Medical Leave
+ Full Time
+ Part Time
+ On call
+ Weekends
+ Specific Days
+ Seasonal
+ Medical Leave
@@ -187,7 +187,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
-
+ {/*
Additional Phone
handleChange('phone', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
@@ -234,7 +234,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
-
+ {/*
Shift Coverage %
handleChange('shift_coverage_percentage', parseInt(e.target.value) || 0)}
className="border-slate-200"
/>
-
+
*/}
-
+ {/*
Cancellation Count
handleChange('cancellation_count', parseInt(e.target.value) || 0)}
className="border-slate-200"
/>
-
+
*/}
{/* New No Show Count field */}
-
+ {/*
No Show Count
handleChange('no_show_count', parseInt(e.target.value) || 0)}
className="border-slate-200"
/>
-
+
*/}
{/* End new No Show Count field */}
-
+ {/*
Total Shifts
handleChange('total_shifts', parseInt(e.target.value) || 0)}
className="border-slate-200"
/>
-
+
*/}
- */}
@@ -314,19 +314,19 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
- Operations
- Sales
+ Operations
+ Sales
HR
- Finance
+ Finance
IT
- Marketing
- Customer Service
- Logistics
+ Marketing
+ Customer Service
+ Logistics
- */}
Hub Location
@@ -347,7 +347,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
-
+ {/*
Event Location
handleChange('event_location', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
Track
@@ -367,7 +367,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
- */}
@@ -394,15 +394,15 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
- Fluent
- Intermediate
- Basic
- None
+ Fluent
+ Intermediate
+ Basic
+ None
- */}
-
+ {/*
Last Check-in
handleChange('check_in', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
- */}
@@ -446,7 +446,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
-
+ {/*
Replaced By
handleChange('replaced_by', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
-
+ {/*
Action
handleChange('action', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
-
+ {/*
R.O
handleChange('ro', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
-
+ {/*
MON
handleChange('mon', e.target.value)}
className="border-slate-200"
/>
-
+
*/}
Notes
@@ -497,7 +497,7 @@ export default function StaffForm({ staff, onSubmit, isSubmitting }) {
/>
-
+ {/*
Accounting Comments
-
+
*/}
diff --git a/frontend-web-free/src/pages/EditStaff.jsx b/frontend-web-free/src/pages/EditStaff.jsx
index 7cca7879..4fa7fcff 100644
--- a/frontend-web-free/src/pages/EditStaff.jsx
+++ b/frontend-web-free/src/pages/EditStaff.jsx
@@ -27,6 +27,10 @@ export default function EditStaff() {
queryClient.invalidateQueries({ queryKey: ['staff'] });
navigate(createPageUrl("Dashboard"));
},
+ onError: (error, variables) => {
+ console.log("data: ",variables);
+ console.error("Update failed", error);
+ },
});
const handleSubmit = (staffData) => {