update place api and admin ui

This commit is contained in:
lesion
2019-03-03 01:04:24 +01:00
parent f3dab2d315
commit c4940eaf12
4 changed files with 29 additions and 3 deletions

View File

@@ -32,7 +32,12 @@ const eventController = {
res.send(404)
}
},
async updatePlace (req, res) {
const place = await Place.findByPk(req.body.id)
console.log(place)
await place.update(req.body)
res.json(place)
},
async get (req, res) {
const id = req.params.event_id
const event = await Event.findByPk(id, { include: [User, Tag, Comment, Place] })