mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* move dailyApiFetcher.ts to app store package * update imports * bookingLocationService * revert * move findFieldValueByIdentifier * wip * fix * fix * fix * fix * fix * fix * fix * move to features package * update imports * update imports * move * fix typechecks * move getCalendarLinks * mv event test
17 lines
491 B
TypeScript
17 lines
491 B
TypeScript
import { handleErrorsJson } from "@calcom/lib/errors";
|
|
|
|
import { getDailyAppKeys } from "./getDailyAppKeys";
|
|
|
|
export const fetcher = async (endpoint: string, init?: RequestInit | undefined) => {
|
|
const { api_key } = await getDailyAppKeys();
|
|
return fetch(`https://api.daily.co/v1${endpoint}`, {
|
|
method: "GET",
|
|
headers: {
|
|
Authorization: `Bearer ${api_key}`,
|
|
"Content-Type": "application/json",
|
|
...init?.headers,
|
|
},
|
|
...init,
|
|
}).then(handleErrorsJson);
|
|
};
|