summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-08-15 20:50:51 +0200
committerAndrés Manelli <andresmanelli@gmail.com>2018-08-15 20:50:51 +0200
commite55d7e4f72a4b425c4aca5ba04a7be1fc642649b (patch)
tree8ef0345047078789aa6156fd4fab606ffd84c722 /models
parent53c0a5278888ad1f97005f5347df09b66e67c5d4 (diff)
downloadwekan-e55d7e4f72a4b425c4aca5ba04a7be1fc642649b.tar.gz
wekan-e55d7e4f72a4b425c4aca5ba04a7be1fc642649b.tar.bz2
wekan-e55d7e4f72a4b425c4aca5ba04a7be1fc642649b.zip
Fix removed setters and getters
Diffstat (limited to 'models')
-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({