summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-08-15 22:08:19 +0300
committerGitHub <noreply@github.com>2018-08-15 22:08:19 +0300
commit5c33a8534186920be642be8e2ac17743a54f16db (patch)
tree8ef0345047078789aa6156fd4fab606ffd84c722 /models/cards.js
parent53c0a5278888ad1f97005f5347df09b66e67c5d4 (diff)
parente55d7e4f72a4b425c4aca5ba04a7be1fc642649b (diff)
downloadwekan-5c33a8534186920be642be8e2ac17743a54f16db.tar.gz
wekan-5c33a8534186920be642be8e2ac17743a54f16db.tar.bz2
wekan-5c33a8534186920be642be8e2ac17743a54f16db.zip
Merge pull request #1831 from andresmanelli/devel
Fix removed setters and getters
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js47
1 files changed, 46 insertions, 1 deletions
diff --git a/models/cards.js b/models/cards.js
index 171c21c5..1cb1e3d0 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -88,7 +88,6 @@ Cards.attachSchema(new SimpleSchema({
type: String,
optional: true,
defaultValue: '',
-
},
assignedBy: {
type: String,
@@ -769,6 +768,52 @@ Cards.helpers({
return this.archived;
}
},
+
+ setRequestedBy(requestedBy) {
+ if (this.isLinkedCard()) {
+ return Cards.update(
+ { _id: this.linkedId },
+ {$set: {requestedBy}}
+ );
+ } else {
+ return Cards.update(
+ {_id: this._id},
+ {$set: {requestedBy}}
+ );
+ }
+ },
+
+ getRequestedBy() {
+ if (this.isLinkedCard()) {
+ const card = Cards.findOne({ _id: this.linkedId });
+ return card.requestedBy;
+ } else {
+ return this.requestedBy;
+ }
+ },
+
+ setAssignedBy(assignedBy) {
+ if (this.isLinkedCard()) {
+ return Cards.update(
+ { _id: this.linkedId },
+ {$set: {assignedBy}}
+ );
+ } else {
+ return Cards.update(
+ {_id: this._id},
+ {$set: {assignedBy}}
+ );
+ }
+ },
+
+ getAssignedBy() {
+ if (this.isLinkedCard()) {
+ const card = Cards.findOne({ _id: this.linkedId });
+ return card.assignedBy;
+ } else {
+ return this.assignedBy;
+ }
+ },
});
Cards.mutations({