소스 검색

Adds start and due date to cards model.

shoetten 9 년 전
부모
커밋
89df0bda9b
1개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 24 0
      models/cards.js

+ 24 - 0
models/cards.js

@@ -56,6 +56,14 @@ Cards.attachSchema(new SimpleSchema({
     type: [String],
     optional: true,
   },
+  startAt: {
+    type: Date,
+    optional: true,
+  },
+  dueAt: {
+    type: Date,
+    optional: true,
+  },
   // XXX Should probably be called `authorId`. Is it even needed since we have
   // the `members` field?
   userId: {
@@ -207,6 +215,22 @@ Cards.mutations({
   unsetCover() {
     return { $unset: { coverId: '' }};
   },
+
+  setStart(startAt) {
+    return { $set: { startAt }};
+  },
+
+  unsetStart() {
+    return { $unset: { startAt: '' }};
+  },
+
+  setDue(dueAt) {
+    return { $set: { dueAt }};
+  },
+
+  unsetDue() {
+    return { $unset: { dueAt: '' }};
+  },
 });
 
 if (Meteor.isServer) {