{"info":{"_postman_id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","name":"wedding-planner-api","description":"<html><head></head><body><p>A simple wedding planner API to manage events. </p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"11452429","collectionId":"2444ce23-2b32-41aa-92a5-8d837d2da59f","publishedId":"T1LHHA3X","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-08-07T04:19:52.000Z"},"item":[{"name":"Wedding","item":[{"name":"List Weddings for User","id":"4451f9ed-9c61-42cb-9ca8-b657bdff5e3e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/weddings","description":"<h4 id=\"get-weddings-display-all-the-weddings-events-on-the-page\">GET Weddings (Display all the weddings events on the page)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.get('/', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n  db.Wedding.findAll({\n    where: {\n      user_email: email,\n    },\n  }).then(function (dbAllWedding) {\n    res.json(dbAllWedding);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","weddings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"4451f9ed-9c61-42cb-9ca8-b657bdff5e3e"},{"name":"Creates a Wedding","id":"6f4440af-61c9-442e-8079-8e1d8ce88f7e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","type":"text","value":"application/json"},{"key":"email","value":"ystamaritq@gmail.com","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"title","type":"text","value":"wedding title"},{"key":"description","type":"text","value":"description wedding"},{"key":"date","type":"text","value":"12/12/2020"},{"key":"time","type":"text","value":"5:30 pm"},{"key":"user_email","type":"text","value":"ystamaritq@gmail.com"}]},"url":"http://localhost:3000/api/weddings?title=wedding 1&description=post a wedding for example&date=august 6, 2020&time=7:37 pm","description":"<h4 id=\"post-wedding-create-a-wedding-event\">POST Wedding (create a wedding event)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.post('/', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n  db.Wedding.create({\n    title: req.body.title,\n    description: req.body.description,\n    date: req.body.date,\n    time: req.body.time,\n    user_email: email,\n  }).then(function (dbCreateWedding) {\n    console.log(dbCreateWedding);\n    res.json(dbCreateWedding);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","weddings"],"host":["localhost"],"query":[{"key":"title","value":"wedding 1"},{"key":"description","value":"post a wedding for example"},{"key":"date","value":"august 6, 2020"},{"key":"time","value":"7:37 pm"}],"variable":[]}},"response":[],"_postman_id":"6f4440af-61c9-442e-8079-8e1d8ce88f7e"},{"name":"Get a Wedding by id","id":"8c9254b4-cb6a-4b2c-b55a-26aa6797ea44","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3001/api/weddings/2","description":"<p>GET Wedding by id (List the event based on the id)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.get('/:id', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n  db.Wedding.findOne({\n    where: {\n      id: req.params.id,\n      user_email: email,\n    },\n  }).then(function (dbAllWeddingById) {\n    console.log(dbAllWeddingById);\n    res.json(dbAllWeddingById);\n  });\n});\n</code></pre>","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","name":"wedding-planner-api","type":"collection"}},"urlObject":{"protocol":"http","port":"3001","path":["api","weddings","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"8c9254b4-cb6a-4b2c-b55a-26aa6797ea44"},{"name":"Updates a Wedding","id":"28244abd-937d-40fe-b1b1-7d57593f0d81","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"title","value":"updayed title","type":"text","disabled":true},{"key":"description","value":"my description","type":"text","disabled":true},{"key":"date","value":"2020-12-12","type":"text","disabled":true},{"key":"time","value":"13:30","type":"text","disabled":true},{"key":"user_email","value":"update_email@gmail.com","type":"text","disabled":true}]},"url":"http://localhost:3001/api/weddings/9","description":"<h4 id=\"update-wedding\">Update Wedding</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.put('/:id', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n  db.Wedding.update(\n    {\n      title: req.body.title,\n      description: req.body.description,\n      date: req.body.date,\n      time: req.body.time,\n    },\n    {\n      where: {\n        id: req.params.id,\n        user_email: email,\n      },\n    },\n  ).then(function (dbUpdateWedding) {\n    res.json(dbUpdateWedding);\n  });\n});\n</code></pre>","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","name":"wedding-planner-api","type":"collection"}},"urlObject":{"protocol":"http","port":"3001","path":["api","weddings","9"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"28244abd-937d-40fe-b1b1-7d57593f0d81"},{"name":"Deletes a Wedding","id":"2a9044de-6179-47a2-b5eb-8d4d5b1ac0c4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/api/weddings/","description":"<h4 id=\"delete-wedding\">Delete Wedding</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.delete('/:id', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n  db.Wedding.destroy({\n    where: {\n      id: req.params.id,\n      user_email: email,\n    },\n  }).then(function (dbWeddingDelete) {\n    res.json(dbWeddingDelete);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","weddings",""],"host":["localhost"],"query":[{"disabled":true,"key":"id","value":null}],"variable":[]}},"response":[],"_postman_id":"2a9044de-6179-47a2-b5eb-8d4d5b1ac0c4"}],"id":"d6e80cf1-a3b0-4a77-b52c-0455caacaf70","description":"<p>Wedding Events APIs</p>\n","_postman_id":"d6e80cf1-a3b0-4a77-b52c-0455caacaf70","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","name":"wedding-planner-api","type":"collection"}}},{"name":"Venue","item":[{"name":"List Venues","id":"560dde21-5db2-4408-862a-5c90d9d6cdbd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/venues?eventid=1","description":"<h4 id=\"get-venues\">GET Venues</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.get('/', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n\n  db.Venue.findAll({\n    where: {\n      WeddingId: req.query.eventid,\n    },\n    include: [\n      {\n        model: db.WeddingId,\n        where: { user_email: email },\n      },\n    ],\n  }).then(function (dbVenuesAll) {\n    res.json(dbVenuesAll);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","venues"],"host":["localhost"],"query":[{"description":{"content":"<p>event id </p>\n","type":"text/plain"},"key":"eventid","value":"1"}],"variable":[]}},"response":[],"_postman_id":"560dde21-5db2-4408-862a-5c90d9d6cdbd"},{"name":"Creates a Venue","id":"79cbe37a-7c22-4829-8fa1-52662c3c1463","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"venue post","type":"text"},{"key":"photo","value":"picture","type":"text"},{"key":"address","value":"value of address","type":"text"},{"key":"url","value":"https://wedding-planner-platform.herokuapp.com/","type":"text"},{"key":"eventId","value":"5","type":"text"}]},"url":"http://localhost:3000/api/venue","description":"<h4 id=\"create-venue\">Create Venue</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.post('/', function (req, res) {\n  db.Venue.create({\n    name: req.body.name,\n    photo: req.body.photo,\n    address: req.body.address,\n    website: req.body.url,\n    WeddingId: req.body.eventId,\n  }).then(function (dbCreateVenue) {\n    res.json(dbCreateVenue);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","venue"],"host":["localhost"],"query":[{"disabled":true,"key":"","value":null},{"disabled":true,"key":"","value":null},{"disabled":true,"key":"","value":null},{"disabled":true,"key":"","value":null}],"variable":[]}},"response":[],"_postman_id":"79cbe37a-7c22-4829-8fa1-52662c3c1463"},{"name":"Updates Venue","id":"710d2026-4b41-44b0-ad12-763f9f6f8003","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[],"url":"http://localhost:3000/api/venue/1","description":"<h4 id=\"updates-venues\">Updates Venues</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.put('/:id', function (req, res) {\n  db.Venue.update(\n    {\n      name: req.body.name,\n      photo: req.body.photo,\n      address: req.body.formatted_address,\n      url: req.body.url,\n    },\n    {\n      where: {\n        id: req.params.id,\n      },\n    },\n  ).then(function (dbUpdateVenue) {\n    res.json(dbUpdateVenue);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","venue","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"710d2026-4b41-44b0-ad12-763f9f6f8003"},{"name":"DELETE Venue","id":"0a176ef8-2782-424e-b7ef-26ba68b44106","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/venue/1?id=2","description":"<h4 id=\"delete-venue\">Delete Venue</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.delete('/:id', function (req, res) {\n  db.Venue.destroy({\n    where: {\n      id: req.params.id,\n    },\n  }).then(function (dbVenueDelete) {\n    res.json(dbVenueDelete);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","venue","1"],"host":["localhost"],"query":[{"key":"id","value":"2"}],"variable":[]}},"response":[],"_postman_id":"0a176ef8-2782-424e-b7ef-26ba68b44106"}],"id":"6d6ddf6a-4db1-4c2d-9214-f5363e472399","description":"<p>Wedding's Venues APIs</p>\n","_postman_id":"6d6ddf6a-4db1-4c2d-9214-f5363e472399","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","name":"wedding-planner-api","type":"collection"}}},{"name":"Guest","item":[{"name":"Create Guest","id":"ae9b9e34-f47a-4046-ae7c-3b679a4cdeeb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","type":"text","value":"aaron"},{"key":"email","type":"text","value":"aaron@gmail.com"},{"key":"phone","type":"text","value":"90867542345"},{"key":"eventid","type":"text","value":"5"}]},"url":"http://localhost:3000/api/guests","description":"<h4 id=\"create-guest\">Create Guest</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.post('/', function (req, res) {\n  //TODOs Validate\n  console.log(req.body);\n  db.Guest.create({\n    name: req.body.name,\n    email: req.body.email,\n    phone: req.body.phone,\n    WeddingId: req.body.eventid,\n  }).then(function (dbCreateGuest) {\n    console.log(dbCreateGuest);\n    res.json(dbCreateGuest);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","guests"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"ae9b9e34-f47a-4046-ae7c-3b679a4cdeeb"},{"name":"List Guests","id":"6760f123-df52-44a9-8d90-c1299d7e5b48","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/guests?eventid=5","description":"<h4 id=\"list-guests\">List Guests</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.get('/', function (req, res) {\n  let email = getEmail(req.headers.authorization);\n\n  db.Guest.findAll({\n    where: {\n      WeddingId: req.query.eventid,\n    },\n    include: [\n      {\n        model: db.Wedding,\n        where: { user_email: email }, // enforces wedding belongs to user email\n      },\n    ],\n  }).then(function (dbGuests) {\n    res.json(dbGuests);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","guests"],"host":["localhost"],"query":[{"key":"eventid","value":"5"}],"variable":[]}},"response":[],"_postman_id":"6760f123-df52-44a9-8d90-c1299d7e5b48"},{"name":"DELETE Guest","id":"de5bc7f7-bf46-4960-bc55-3d430678aae0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/api/guests/2","description":"<h4 id=\"delete-guest\">Delete Guest</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.delete('/:id', function (req, res) {\n  db.Guest.destroy({\n    where: {\n      id: req.params.id,\n    },\n  }).then(function (dbGuestDelete) {\n    res.json(dbGuestDelete);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","guests","2"],"host":["localhost"],"query":[{"disabled":true,"key":"eventid","value":"9"}],"variable":[]}},"response":[],"_postman_id":"de5bc7f7-bf46-4960-bc55-3d430678aae0"},{"name":"Update Guest","id":"f9dd66c7-8a03-45ed-9347-0a2cb099bfbd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[],"url":"http://localhost:3000/api/guests/2","description":"<h4 id=\"update-guest\">Update Guest</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>router.put('/:id', function (req, res) {\n  db.Guest.update(\n    {\n      name: req.body.name,\n      email: req.body.email,\n      phone: req.body.phone,\n    },\n    {\n      where: {\n        id: req.params.id,\n      },\n    },\n  ).then(function (dbUpdateGuestById) {\n    res.json(dbUpdateGuestById);\n  });\n});\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["api","guests","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"f9dd66c7-8a03-45ed-9347-0a2cb099bfbd"}],"id":"1a84ce94-6ebe-41f5-9bb9-358d136f66f1","event":[{"listen":"prerequest","script":{"id":"c3d9b620-bcc7-4b9a-830c-3c5dda19b3a0","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"de4b9eb9-72be-42ca-b8e5-152b11f8af11","type":"text/javascript","exec":[""]}}],"_postman_id":"1a84ce94-6ebe-41f5-9bb9-358d136f66f1","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","id":"2444ce23-2b32-41aa-92a5-8d837d2da59f","name":"wedding-planner-api","type":"collection"}}}],"auth":{"type":"bearer","bearer":{"basicConfig":[]}},"event":[{"listen":"prerequest","script":{"id":"14492d85-9d06-4558-b3df-f515c83178fe","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"94da04c5-abf7-4020-9d49-fe3d15f04b00","type":"text/javascript","exec":[""]}}]}