update place api and admin ui
This commit is contained in:
@@ -22,6 +22,7 @@ api.route('/user')
|
||||
|
||||
api.get('/users', isAuth, isAdmin, userController.getAll)
|
||||
api.put('/tag', isAuth, isAdmin, eventController.updateTag)
|
||||
api.put('/place', isAuth, isAdmin, eventController.updatePlace)
|
||||
|
||||
api.route('/user/event')
|
||||
.post(isAuth, upload.single('image'), userController.addEvent)
|
||||
|
||||
@@ -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] })
|
||||
|
||||
Reference in New Issue
Block a user