summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-04-16 14:33:53 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-04-16 14:43:10 -0300
commite5995477b80a3c8e9fd423d14fd818a5b3ad5aa0 (patch)
tree420339982c4f9903e4f193ee19ac177a766ed330 /models
parentc12e003fd3ecc50bee64931bc19febee1b99c103 (diff)
downloadwekan-e5995477b80a3c8e9fd423d14fd818a5b3ad5aa0.tar.gz
wekan-e5995477b80a3c8e9fd423d14fd818a5b3ad5aa0.tar.bz2
wekan-e5995477b80a3c8e9fd423d14fd818a5b3ad5aa0.zip
Fix #1567
Diffstat (limited to 'models')
-rw-r--r--models/boards.js8
-rw-r--r--models/users.js16
2 files changed, 15 insertions, 9 deletions
diff --git a/models/boards.js b/models/boards.js
index 436a99f5..3e05b499 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -31,14 +31,6 @@ Boards.attachSchema(new SimpleSchema({
}
},
},
- view: {
- type: String,
- autoValue() { // eslint-disable-line consistent-return
- if (this.isInsert) {
- return 'board-view-lists';
- }
- },
- },
createdAt: {
type: Date,
autoValue() { // eslint-disable-line consistent-return
diff --git a/models/users.js b/models/users.js
index da8ca77c..41179875 100644
--- a/models/users.js
+++ b/models/users.js
@@ -43,7 +43,9 @@ Users.attachSchema(new SimpleSchema({
optional: true,
autoValue() { // eslint-disable-line consistent-return
if (this.isInsert && !this.isSet) {
- return {};
+ return {
+ boardView: 'board-view-lists',
+ };
}
},
},
@@ -95,6 +97,10 @@ Users.attachSchema(new SimpleSchema({
type: String,
optional: true,
},
+ 'profile.boardView': {
+ type: String,
+ optional: true,
+ },
services: {
type: Object,
optional: true,
@@ -329,6 +335,14 @@ Users.mutations({
setShowCardsCountAt(limit) {
return {$set: {'profile.showCardsCountAt': limit}};
},
+
+ setBoardView(view) {
+ return {
+ $set : {
+ 'profile.boardView': view,
+ },
+ };
+ },
});
Meteor.methods({