ui fix for shift UI

This commit is contained in:
Dobromir Popov
2024-05-29 00:12:42 +03:00
parent 4f8d72c162
commit c8367026dd
2 changed files with 3 additions and 4 deletions

View File

@ -367,6 +367,8 @@ export default function CalendarPage({ initialEvents, initialShifts }) {
const { data } = await axiosInstance.post("/api/data/assignments", newAssignment);
// Update the 'publisher' property of the returned data with the full publisher object
data.publisher = publisher;
data.shift = shifts.find(shift => shift.id === shiftId);
publisher.assignments = [...publisher.assignments, data];
handleAssignmentChange(publisher.id, 'add');
} catch (error) {
console.error("Error adding assignment:", error);