Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Returns a single event based on the id or url in the endpoint parameters (/api/single/:event_id). You can pass either the id or the url and the service will try to find the event based on both database fields and add it to req.event. Bear in mind that it will return it as a mongoose object, if you want to tinker around with the object, use .toObject() first. Also userdata will not be complete after this stage. If you need more information about the users, have a look at populateUsers in users.js and how it is used in the event.js - eventDetails handler. 

Code Block
languagejs
{
"success": true,
"data": {
"_id": "58da349b45e3a800140c4000",
"url": "58da349b45e3a800140c4000",
"updatedAt": "2017-03-28T10:02:03.486Z",
"createdAt": "2017-03-28T10:02:03.486Z",
"lifecycle": "58da348645e3a800140c3fff",
"status": {
"_id": "58da348645e3a800140c3ffd",
"__v": 0,
"name": "Default name 1",
"visibility": {
"special": [
"Public"
],
"bodies": [],
"roles": [],
"users": []
}
},
"name": "asdasd",
"starts": "2017-03-28T22:10:00.000Z",
"ends": "2017-04-08T12:10:00.000Z",
"__v": 0,
"organizers": [
{
"foreign_id": "1",
"_id": "58da349b45e3a800140c4001",
"roles": [
{
"_id": "58bfac6e0223b6002b88266c",
"cfg_id": "6",
"name": "Creator",
"description": "The user who created the event, automatically assigned",
"__v": 0
}
],
"data": {
"first_name": "Flaviu",
"last_name": "Porutiu",
"antenna_name": "Global antenna"
}
}
],
"application_fields": [],
"application_status": "closed",
"max_participants": 0,
"type": "Default event type",
"organizing_locals": [
{
"name": "Global antenna",
"foreign_id": "1",
"_id": "58da349b45e3a800140c4002"
}
],
"description": "asdas",
"head_image": {
"url": ""
},
"id": "58da349b45e3a800140c4000"
}
}

...