added ? to colors in calendar and changed the api calls to get all personnal calendars
This commit is contained in:
@@ -16,7 +16,7 @@ export async function getCalendars(userId: string, opaque_token: string) {
|
|||||||
|
|
||||||
export async function getCalendar(id: string, opaque_token: string) {
|
export async function getCalendar(id: string, opaque_token: string) {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${process.env.PUBLIC_CALENDAR_BASE_URL}/dav/calendars/${id}/${id}.json`,
|
`${process.env.PUBLIC_CALENDAR_BASE_URL}/dav/calendars/${id}.json`,
|
||||||
{
|
{
|
||||||
method: "REPORT",
|
method: "REPORT",
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ export const getCalendarsAsync = createAsyncThunk<
|
|||||||
? cal["calendarserver:source"]._links.self.href
|
? cal["calendarserver:source"]._links.self.href
|
||||||
.replace("/calendars/", "")
|
.replace("/calendars/", "")
|
||||||
.replace(".json", "")
|
.replace(".json", "")
|
||||||
.split("/")[0]
|
|
||||||
: cal._links.self.href
|
: cal._links.self.href
|
||||||
.replace("/calendars/", "")
|
.replace("/calendars/", "")
|
||||||
.replace(".json", "")
|
.replace(".json", "")
|
||||||
.split("/")[0];
|
|
||||||
|
|
||||||
const color = cal["apple:color"];
|
const color = cal["apple:color"];
|
||||||
const calendarDetails = await getCalendar(id, access_token);
|
const calendarDetails = await getCalendar(id, access_token);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export interface Calendars {
|
|||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
prodid?: string;
|
prodid?: string;
|
||||||
color: string;
|
color?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
calscale?: string;
|
calscale?: string;
|
||||||
version?: string;
|
version?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user