diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-06-17 20:21:44 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-06-17 20:21:44 +0300 |
commit | f245b6b7faa29b4f276527daca48c305fe9689c1 (patch) | |
tree | 01db3252bba00b5a892731e606b0bf346ff69379 /models/users.js | |
parent | ad87f9ff4e50e8b042735ad383c5c193e30fc9aa (diff) | |
download | wekan-f245b6b7faa29b4f276527daca48c305fe9689c1.tar.gz wekan-f245b6b7faa29b4f276527daca48c305fe9689c1.tar.bz2 wekan-f245b6b7faa29b4f276527daca48c305fe9689c1.zip |
Update users.js etc with global search replace, to try to fix selecting correct user.
Thanks to xet7 !
Diffstat (limited to 'models/users.js')
-rw-r--r-- | models/users.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/users.js b/models/users.js index 8675dbad..d1a85c37 100644 --- a/models/users.js +++ b/models/users.js @@ -1277,7 +1277,7 @@ if (Meteor.isServer) { JsonRoutes.add('GET', '/api/user', function(req, res) { try { Authentication.checkLoggedIn(req.userId); - const data = Meteor.users.findOne({ _id: req.userId }); + const data = Users.findOne({ _id: req.userId }); delete data.services; // get all boards where the user is member of @@ -1368,7 +1368,7 @@ if (Meteor.isServer) { return u; }); - const user = Meteor.users.findOne({ _id: id }); + const user = Users.findOne({ _id: id }); user.boards = boards; JsonRoutes.sendResult(res, { code: 200, @@ -1404,7 +1404,7 @@ if (Meteor.isServer) { Authentication.checkUserId(req.userId); const id = req.params.userId; const action = req.body.action; - let data = Meteor.users.findOne({ _id: id }); + let data = Users.findOne({ _id: id }); if (data !== undefined) { if (action === 'takeOwnership') { data = Boards.find( @@ -1437,7 +1437,7 @@ if (Meteor.isServer) { } else if (action === 'enableLogin') { Users.update({ _id: id }, { $set: { loginDisabled: '' } }); } - data = Meteor.users.findOne({ _id: id }); + data = Users.findOne({ _id: id }); } } JsonRoutes.sendResult(res, { @@ -1481,7 +1481,7 @@ if (Meteor.isServer) { const boardId = req.params.boardId; const action = req.body.action; const { isAdmin, isNoComments, isCommentOnly } = req.body; - let data = Meteor.users.findOne({ _id: userId }); + let data = Users.findOne({ _id: userId }); if (data !== undefined) { if (action === 'add') { data = Boards.find({ @@ -1542,7 +1542,7 @@ if (Meteor.isServer) { const userId = req.params.userId; const boardId = req.params.boardId; const action = req.body.action; - let data = Meteor.users.findOne({ _id: userId }); + let data = Users.findOne({ _id: userId }); if (data !== undefined) { if (action === 'remove') { data = Boards.find({ |