2023-09-13 16:59:17 +02:00
|
|
|
import MapModel from '../db/models/map.js'
|
|
|
|
|
2023-09-14 14:25:53 +02:00
|
|
|
const createPoint = async (req, res, next) => {
|
2023-09-13 16:59:17 +02:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-14 14:25:53 +02:00
|
|
|
const updatePoint = async (req, res, next) => {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const deletePoint = async (req, res, next) => {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export { createPoint, updatePoint, deletePoint }
|