From e5995477b80a3c8e9fd423d14fd818a5b3ad5aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Mon, 16 Apr 2018 14:33:53 -0300 Subject: Fix #1567 --- models/boards.js | 8 -------- models/users.js | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'models') 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({ -- cgit v1.2.3-1-g7c22