Refactor imports (#470)

This commit is contained in:
Camille Moussu
2026-01-20 17:33:30 +01:00
committed by GitHub
parent aeb8670895
commit 23d50f250d
149 changed files with 1439 additions and 1374 deletions
@@ -0,0 +1,24 @@
import { getEvent } from "@/features/Events/EventApi";
import { CalendarEvent } from "@/features/Events/EventsTypes";
import { formatReduxError } from "@/utils/errorUtils";
import { createAsyncThunk } from "@reduxjs/toolkit";
import { RejectedError } from "../CalendarSlice";
export const getEventAsync = createAsyncThunk<
{ calId: string; event: CalendarEvent },
CalendarEvent,
{ rejectValue: RejectedError }
>("calendars/getEvent", async (event, { rejectWithValue }) => {
try {
const response: CalendarEvent = await getEvent(event);
return {
calId: event.calId,
event: response,
};
} catch (err: any) {
return rejectWithValue({
message: formatReduxError(err),
status: err.response?.status,
});
}
});