You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
360 B
18 lines
360 B
import MapModel from '../db/models/map.js'
|
|
|
|
const setPoint = async (req, res, next) => {
|
|
try {
|
|
const { mapId, point } = req.body
|
|
|
|
console.log(req.body)
|
|
|
|
const map = await MapModel.query().findById(mapId)
|
|
const p = await map.$relatedQuery('map_points').insert(point)
|
|
|
|
res.json(p)
|
|
} catch (err) {
|
|
next(err)
|
|
}
|
|
}
|
|
|
|
export { setPoint }
|
|
|