Skip to content

Create Available Time Slots from FreeBusy API #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

singhmi4
Copy link
Collaborator

What it Does

  • queries the freebusy api using the Date: Dec 13, 2020 and start and end times of 9 am to 5 pm respectively:
    image

  • returns an array of objects of the available timeslots when there is an opening in the calendar:

Method: GET
Path:   /api/avail/freebusy
Body:   {}
---
time slot start 12/13/2020, 10:00:00 AM
time slot end 12/13/2020, 11:00:00 AM
time slot start 12/13/2020, 1:30:00 PM
time slot end 12/13/2020, 2:30:00 PM
time slot start 12/13/2020, 2:30:00 PM
time slot end 12/13/2020, 3:30:00 PM

Returned JSON:

[
  {
    "start":"2020-12-13T15:00:00.000Z",
    "end":"2020-12-13T16:00:00.000Z"
  },
  {
    "start":"2020-12-13T18:30:00.000Z",
    "end":"2020-12-13T19:30:00.000Z"
  },
  {
    "start":"2020-12-13T19:30:00.000Z",
    "end":"2020-12-13T20:30:00.000Z"
  }
]

What to Look For

  • DRY code

What to Avoid:

  • date and start and end time for query are constant right now

@singhmi4 singhmi4 requested a review from bonnieli December 13, 2020 02:41
@singhmi4 singhmi4 marked this pull request as draft December 13, 2020 15:29
@singhmi4
Copy link
Collaborator Author

Changed status to draft because I need to consider the option where there are no previous events in the calendar

@singhmi4 singhmi4 marked this pull request as ready for review December 13, 2020 15:44
@@ -25,4 +37,50 @@ authRouter.get("/users/me", ensureAuth, (request, response) => {
});
});

// @desc Get calendar list
// @route GET /calendarList
authRouter.get("/calendar", ensureAuth, (request, response) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this being used anymore, if not, remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate availabilities BE: Availability Controllers GET /availability
2 participants