Skip to content

Commit

Permalink
read calendars based on CALENDAR_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
lucia-gomez committed Mar 19, 2024
1 parent 0a5ecbf commit 5068098
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ export const RoomCalendar = ({
const [events, setEvents] = useState([]);

useEffect(() => {
//PROD
fetchCalendarEvents(room.calendarIdProd);
//DEV
//fetchCalendarEvents(room.calendarId);
console.log(
'Fetching calendar events from:',
process.env.CALENDAR_ENV,
'calendars'
);
fetchCalendarEvents(
process.env.CALENDAR_ENV === 'production'
? room.calendarIdProd
: room.calendarId
);
}, []);

const fetchCalendarEvents = async (calendarId) => {
serverFunctions.getCalendarEvents(calendarId).then((rows) => {
setEvents(rows);
Expand Down

1 comment on commit 5068098

@lucia-gomez
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.