diff --git a/test/helpers/api-integration.helper.js b/test/helpers/api-integration.helper.js index 027d719edd..973414a3a8 100644 --- a/test/helpers/api-integration.helper.js +++ b/test/helpers/api-integration.helper.js @@ -277,6 +277,7 @@ function _updateDocument (collectionName, doc, update, cb) { return cb(); } + // TODO use config for db url? mongo.connect('mongodb://localhost/habitrpg_test', (connectErr, db) => { if (connectErr) throw new Error(`Error connecting to database when updating ${collectionName} collection: ${connectErr}`); diff --git a/website/src/controllers/api-v3/tags.js b/website/src/controllers/api-v3/tags.js index 4917858449..db601e968e 100644 --- a/website/src/controllers/api-v3/tags.js +++ b/website/src/controllers/api-v3/tags.js @@ -69,7 +69,7 @@ api.getTag = { handler (req, res, next) { let user = res.locals.user; - req.checkParams('taskId', res.t('tagIdRequired')).notEmpty().isUUID(); + req.checkParams('tagId', res.t('tagIdRequired')).notEmpty().isUUID(); let validationErrors = req.validationErrors(); if (validationErrors) return next(validationErrors); @@ -100,7 +100,7 @@ api.updateTag = { req.checkParams('tagId', res.t('tagIdRequired')).notEmpty().isUUID(); // TODO check that req.body isn't empty - let tagId = req.params.id; + let tagId = req.params.tagId; let validationErrors = req.validationErrors(); if (validationErrors) return next(validationErrors); @@ -127,7 +127,7 @@ api.updateTag = { * @apiSuccess {object} empty An empty object */ api.deleteTag = { - method: 'GET', + method: 'DELETE', url: '/tags/:tagId', middlewares: [authWithHeaders()], handler (req, res, next) {