diff --git a/backend/routes/update.js b/backend/routes/update.js index 8653f5d..6ad723e 100644 --- a/backend/routes/update.js +++ b/backend/routes/update.js @@ -22,14 +22,14 @@ module.exports = dbConn => { /** * @swagger * /update/climate/v1: - * patch: - * summary: Pull monthly data from meteostat API V2 + * put: + * summary: Pull monthly data from meteostat API V1 * tags: [Update] * responses: * "200": * description: Update information is logged in backend */ - router.patch("/api/v1/update/climate/v1", async (req, res) => { + router.put("/api/v1/update/climate/v1", async (req, res) => { const update = await handleClimateUpdate(dbConn) res.json(update) }); @@ -37,14 +37,14 @@ module.exports = dbConn => { /** * @swagger * /update/climate/v2: - * patch: - * summary: Pull daily data from meteostat API V2 + * put: + * summary: Pull daily data from meteostat API V2. Data is written to Travopti database and must be processed manually before it can be used. * tags: [Update] * responses: * "200": * description: Update information is logged in backend */ - router.patch("/api/v1/update/climate/v2", async (req, res) => { + router.put("/api/v1/update/climate/v2", async (req, res) => { const update = await handleClimateUpdateV2(dbConn) res.json(update) }); @@ -52,49 +52,49 @@ module.exports = dbConn => { /** * @swagger * /update/regions/all/nearby: - * patch: + * put: * summary: Updates all nearby data for all regions * tags: [Update] * responses: * "200": * description: Updates all nearby data for all regions */ - router.patch("/api/v1/update/regions/all/nearby", async (req, res) => { + router.put("/api/v1/update/regions/all/nearby", async (req, res) => { res.json(await handleUpdateRegionNearby(dbConn)) }); /** * @swagger * /update/regions/all/lonlat: - * patch: + * put: * summary: Updates all coordinate data for all regions * tags: [Update] * responses: * "200": * description: Updates all coordinate data for all regions */ - router.patch("/api/v1/update/regions/all/lonlat", async (req,res) => { + router.put("/api/v1/update/regions/all/lonlat", async (req,res) => { res.json(await handleRegionLonLat(dbConn)) }); /** * @swagger * /update/regions/all/nearby/image: - * patch: + * put: * summary: Updates the nearby image urls for all regions * tags: [Update] * responses: * "200": * description: Updates the nearby image urls for all regions */ - router.patch("/api/v1/update/regions/all/nearby/image", async (req, res) => { + router.put("/api/v1/update/regions/all/nearby/image", async (req, res) => { res.json(await handleUpdateRegionNearbyImgUrl(dbConn)) }); /** * @swagger * /update/regions/{id}/nearby: - * patch: + * put: * summary: Updates the nearby data for a specific region * tags: [Update] * parameters: @@ -106,7 +106,7 @@ module.exports = dbConn => { * "200": * description: Updates the nearby data for a specific region */ - router.patch("/api/v1/update/regions/:id/nearby", async (req, res) => { + router.put("/api/v1/update/regions/:id/nearby", async (req, res) => { const id = sqlSanitzer(req.params.id); res.json(await handleUpdateRegionNearbyById(dbConn, id)) }); @@ -114,7 +114,7 @@ module.exports = dbConn => { /** * @swagger * /update/regions/{id}/nearby/image: - * patch: + * put: * summary: Updates the nearby image urls for a specific region * tags: [Update] * parameters: @@ -126,7 +126,7 @@ module.exports = dbConn => { * "200": * description: Updates the nearby image urls for a specific region */ - router.patch("/api/v1/update/regions/:id/nearby/image", async (req, res) => { + router.put("/api/v1/update/regions/:id/nearby/image", async (req, res) => { const id = sqlSanitzer(req.params.id); res.json(await handleUpdateRegionNearbyImgUrlById(dbConn, id)) });