[#4] attendance now change event display
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -5,6 +5,7 @@ export interface Calendars {
|
||||
name: string;
|
||||
prodid?: string;
|
||||
color?: string;
|
||||
ownerEmails?: string[];
|
||||
description?: string;
|
||||
calscale?: string;
|
||||
version?: string;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user