Merge pull request #2610 from JimCircadian/custom-field-api-insert

Updated insert action for CustomFields API
This commit is contained in:
Lauri Ojansivu 2019-08-12 20:04:49 +03:00 committed by GitHub
commit 6d47c2e568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -302,6 +302,7 @@ if (Meteor.isServer) {
) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const board = Boards.findOne({ _id: paramBoardId });
const id = CustomFields.direct.insert({
name: req.body.name,
type: req.body.type,
@ -309,7 +310,7 @@ if (Meteor.isServer) {
showOnCard: req.body.showOnCard,
automaticallyOnCard: req.body.automaticallyOnCard,
showLabelOnMiniCard: req.body.showLabelOnMiniCard,
boardIds: { $in: [paramBoardId] },
boardIds: [board._id],
});
const customField = CustomFields.findOne({