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.
25 lines
470 B
25 lines
470 B
import MapModel from '../db/models/map.js'
|
|
|
|
const createPoint = async (req, res, next) => {
|
|
try {
|
|
const { mapId, point } = 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)
|
|
}
|
|
}
|
|
|
|
const updatePoint = async (req, res, next) => {
|
|
|
|
}
|
|
|
|
const deletePoint = async (req, res, next) => {
|
|
|
|
}
|
|
|
|
|
|
export { createPoint, updatePoint, deletePoint }
|
|
|