return filters only for api v2

This commit is contained in:
Matteo Pagliazzi 2016-04-10 19:51:05 +02:00
parent 01a2afc12f
commit 2f4f62f342

View file

@ -533,7 +533,7 @@ schema.plugin(baseModel, {
'invitations', 'balance', 'backer', 'contributor'],
private: ['auth.local.hashed_password', 'auth.local.salt'],
toJSONTransform: function userToJSON (plainObj, originalDoc) {
plainObj.filters = {}; // TODO Not saved
// plainObj.filters = {}; TODO Not saved
plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs TODO how to test?
return plainObj;
@ -753,6 +753,7 @@ schema.methods.getTasks = function getUserTasks () {
// Given user and an array of tasks, return an API compatible user + tasks obj
schema.methods.addTasksToUser = function addTasksToUser (tasks) {
let obj = this.toJSON();
obj.filters = {};
obj.tags = obj.tags.map(tag => {
return {