[#4] attendance now change event display

This commit is contained in:
Camille Moussu
2025-08-01 17:41:13 +02:00
parent a71d1f12fb
commit cd829703e9
6 changed files with 111 additions and 3 deletions
+10 -3
View File
@@ -2,7 +2,7 @@ import { createAsyncThunk, createSlice, PayloadAction } from "@reduxjs/toolkit";
import { Calendars } from "./CalendarTypes";
import { CalendarEvent } from "../Events/EventsTypes";
import { getCalendar, getCalendars } from "./CalendarApi";
import getOpenPaasUser from "../User/userAPI";
import getOpenPaasUser, { getUserDetails } from "../User/userAPI";
import { parseCalendarEvent } from "../Events/eventUtils";
import { deleteEvent, putEvent } from "../Events/EventApi";
import { formatDateToYYYYMMDDTHHMMSS } from "../../utils/dateUtils";
@@ -24,9 +24,16 @@ export const getCalendarsListAsync = createAsyncThunk<
.replace("/calendars/", "")
.replace(".json", "")
: cal._links.self.href.replace("/calendars/", "").replace(".json", "");
const ownerData: any = await getUserDetails(id.split("/")[0]);
const color = cal["apple:color"];
importedCalendars[id] = { id, name, description, color, events: {} };
importedCalendars[id] = {
id,
name,
ownerEmails: ownerData.emails,
description,
color,
events: {},
};
}
return importedCalendars;
+1
View File
@@ -5,6 +5,7 @@ export interface Calendars {
name: string;
prodid?: string;
color?: string;
ownerEmails?: string[];
description?: string;
calscale?: string;
version?: string;
+5
View File
@@ -25,3 +25,8 @@ export async function searchUsers(query: string) {
avatarUrl: user.photos?.[0]?.url || "",
}));
}
export async function getUserDetails(id: string) {
const user = await api.get(`api/users/${id}`).json();
return user;
}