mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30: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,21 +403,28 @@ 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 id = Cards.insert({
|
const check = Users.findOne({_id:req.body.authorId});
|
||||||
title: req.body.title,
|
if(typeof check !== 'undefined') {
|
||||||
boardId: paramBoardId,
|
const id = Cards.insert({
|
||||||
listId: paramListId,
|
title: req.body.title,
|
||||||
description: req.body.description,
|
boardId: paramBoardId,
|
||||||
userId : req.body.authorId,
|
listId: paramListId,
|
||||||
sort: 0,
|
description: req.body.description,
|
||||||
members:[ req.body.authorId ],
|
userId: req.body.authorId,
|
||||||
});
|
sort: 0,
|
||||||
JsonRoutes.sendResult(res, {
|
members: [req.body.authorId],
|
||||||
code: 200,
|
});
|
||||||
data: {
|
JsonRoutes.sendResult(res, {
|
||||||
_id: id,
|
code: 200,
|
||||||
},
|
data: {
|
||||||
});
|
_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