Use lean in more places

This commit is contained in:
Phillip Thelen
2026-01-28 20:56:29 +01:00
parent e1a68cd02a
commit b97dfdfa83
12 changed files with 20 additions and 14 deletions
+2 -2
View File
@@ -388,7 +388,7 @@ api.getUserTasks = {
method: 'GET',
url: '/tasks/user',
middlewares: [authWithHeaders({
// Some fields (including _id, preferences) are always loaded (see middlewares/auth)
leanUser: true,
userFieldsToInclude: ['tasksOrder'],
})],
async handler (req, res) {
@@ -953,7 +953,7 @@ api.addChecklistItem = {
api.scoreCheckListItem = {
method: 'POST',
url: '/tasks/:taskId/checklist/:itemId/score',
middlewares: [authWithHeaders()],
middlewares: [authWithHeaders({ leanUser: true, userFieldsToInclude: ['_id'] })],
async handler (req, res) {
const { user } = res.locals;