summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2018-06-26 11:10:16 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2018-10-23 18:02:15 +0200
commit9aa5584c9c7a5bf7d9755dd266a0b0035f57ebf0 (patch)
treec55ddd688f6d08db1716b669e5f54e971b8effc1 /models/boards.js
parent24f66c9f8873e56dcd3a0a176b3fcbbdc6e5fae7 (diff)
downloadwekan-9aa5584c9c7a5bf7d9755dd266a0b0035f57ebf0.tar.gz
wekan-9aa5584c9c7a5bf7d9755dd266a0b0035f57ebf0.tar.bz2
wekan-9aa5584c9c7a5bf7d9755dd266a0b0035f57ebf0.zip
models: make the REST API more uniform
All of the other REST API are in the form 'modelId' but a few ones in boards.js and users.js. Change it for a more uniform API.
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/models/boards.js b/models/boards.js
index 52d0ca87..a44de8fa 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -823,9 +823,9 @@ if (Meteor.isServer) {
}
});
- JsonRoutes.add('GET', '/api/boards/:id', function (req, res) {
+ JsonRoutes.add('GET', '/api/boards/:boardId', function (req, res) {
try {
- const id = req.params.id;
+ const id = req.params.boardId;
Authentication.checkBoardAccess(req.userId, id);
JsonRoutes.sendResult(res, {
@@ -878,10 +878,10 @@ if (Meteor.isServer) {
}
});
- JsonRoutes.add('DELETE', '/api/boards/:id', function (req, res) {
+ JsonRoutes.add('DELETE', '/api/boards/:boardId', function (req, res) {
try {
Authentication.checkUserId(req.userId);
- const id = req.params.id;
+ const id = req.params.boardId;
Boards.remove({ _id: id });
JsonRoutes.sendResult(res, {
code: 200,
@@ -898,9 +898,9 @@ if (Meteor.isServer) {
}
});
- JsonRoutes.add('PUT', '/api/boards/:id/labels', function (req, res) {
+ JsonRoutes.add('PUT', '/api/boards/:boardId/labels', function (req, res) {
Authentication.checkUserId(req.userId);
- const id = req.params.id;
+ const id = req.params.boardId;
try {
if (req.body.hasOwnProperty('label')) {
const board = Boards.findOne({ _id: id });