mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
checking the authorId when adding card
This commit is contained in:
parent
afc30226ac
commit
cac82e4330
1 changed files with 22 additions and 15 deletions
|
|
@ -403,6 +403,8 @@ if (Meteor.isServer) {
|
||||||
Authentication.checkUserId( req.userId);
|
Authentication.checkUserId( req.userId);
|
||||||
const paramBoardId = req.params.boardId;
|
const paramBoardId = req.params.boardId;
|
||||||
const paramListId = req.params.listId;
|
const paramListId = req.params.listId;
|
||||||
|
const check = Users.findOne({_id:req.body.authorId});
|
||||||
|
if(typeof check !== 'undefined') {
|
||||||
const id = Cards.insert({
|
const id = Cards.insert({
|
||||||
title: req.body.title,
|
title: req.body.title,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
|
|
@ -418,6 +420,11 @@ if (Meteor.isServer) {
|
||||||
_id: id,
|
_id: id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
JsonRoutes.sendResult(res, {
|
||||||
|
code: 401,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JsonRoutes.add('PUT', '/api/boards/:boardId/lists/:listId/cards/:cardId', function (req, res, next) {
|
JsonRoutes.add('PUT', '/api/boards/:boardId/lists/:listId/cards/:cardId', function (req, res, next) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue