[#48] fixed drag and drop waiting for api call to be done to show updated event

This commit is contained in:
Camille Moussu
2025-08-19 15:27:54 +02:00
parent 86b57c2338
commit 22ebf31f77
2 changed files with 13 additions and 3 deletions
+9 -1
View File
@@ -114,6 +114,13 @@ const CalendarSlice = createSlice({
action.payload.eventUid
];
},
updateEventLocal: (
state,
action: PayloadAction<{ calId: string; event: CalendarEvent }>
) => {
const { calId, event } = action.payload;
state.list[calId].events[event.uid] = event;
},
},
extraReducers: (builder) => {
builder
@@ -197,5 +204,6 @@ const CalendarSlice = createSlice({
},
});
export const { addEvent, removeEvent, createCalendar } = CalendarSlice.actions;
export const { addEvent, removeEvent, createCalendar, updateEventLocal } =
CalendarSlice.actions;
export default CalendarSlice.reducer;