I am trying to make an events calendar based on this tutorial.
The calendar depicts events by accepting JSON(an array of objects where each object contains data related event) by the server.
Here is an example:
I have a problem though:
All the above data are taken from a single table row…there is some data though that exist in another table and it MAY be comprised of more that one row
It is a table which list services chosen by user and as you might guess an event might be associated with more than service(meaning more than one row).
How could I incorporate the services in the above JSON?
Should I add another member where it will be an array containing the services?
yes,I must clarify that.The events calendar is actually a calendar where appointments are stored…and an appointment(in a hair salon for example) might be associated with more than one service-as is often the case.
If you don’t need to display them unless the user clicks the appointment for more information (for example), then you could return the information about the services in a separate request, from a separate end-point of your API, to keep things cleaner.