|
@@ -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({
|
|
|
|
- title: req.body.title,
|
|
|
|
- boardId: paramBoardId,
|
|
|
|
- listId: paramListId,
|
|
|
|
- description: req.body.description,
|
|
|
|
- userId : req.body.authorId,
|
|
|
|
- sort: 0,
|
|
|
|
- members:[ req.body.authorId ],
|
|
|
|
- });
|
|
|
|
- JsonRoutes.sendResult(res, {
|
|
|
|
- code: 200,
|
|
|
|
- data: {
|
|
|
|
- _id: id,
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ const check = Users.findOne({_id:req.body.authorId});
|
|
|
|
+ if(typeof check !== 'undefined') {
|
|
|
|
+ const id = Cards.insert({
|
|
|
|
+ title: req.body.title,
|
|
|
|
+ boardId: paramBoardId,
|
|
|
|
+ listId: paramListId,
|
|
|
|
+ description: req.body.description,
|
|
|
|
+ userId: req.body.authorId,
|
|
|
|
+ sort: 0,
|
|
|
|
+ members: [req.body.authorId],
|
|
|
|
+ });
|
|
|
|
+ JsonRoutes.sendResult(res, {
|
|
|
|
+ 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) {
|