Skip to content

Commit

Permalink
fix: add cors proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mahyarmirrashed committed Dec 16, 2024
1 parent da35a71 commit ec98192
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/data/university-of-waterloo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ interface WaterlooOpenClassroomSlots {
}[];
}

interface CORSProxy {
contents: string;
}

export const locations: Space[] = [
{
value: "dana-porter-library",
Expand Down Expand Up @@ -73,8 +77,9 @@ export const locations: Space[] = [

(async function () {
try {
const response = await fetch(PUBLIC_API_ENDPOINT__UNIVERISTY_OF_WATERLOO);
const waterlooData: WaterlooClassrooms = await response.json();
const rep = await fetch(PUBLIC_API_ENDPOINT__UNIVERISTY_OF_WATERLOO);
const repProxy: CORSProxy = await rep.json();
const waterlooData: WaterlooClassrooms = JSON.parse(repProxy.contents);

const weekdays: Weekdays[] = [
"monday",
Expand Down

0 comments on commit ec98192

Please sign in to comment.