From e594698f2d24dfe56d3e9082cbf35d1a91cb0268 Mon Sep 17 00:00:00 2001 From: Sergio Gutierrez Villalba Date: Wed, 15 Nov 2023 14:06:51 +0100 Subject: [PATCH] hotfix: calculate usage properly --- src/app/services/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/services/user.js b/src/app/services/user.js index ffe66b4b..fc98214c 100644 --- a/src/app/services/user.js +++ b/src/app/services/user.js @@ -501,7 +501,7 @@ module.exports = (Model, App) => { const getUsage = async (user) => { const targetUser = await Model.users.findOne({ where: { username: user.bridgeUser } }); const usage = await Model.file.findAll({ - where: { user_id: targetUser.id, status: 'EXISTS' }, + where: { user_id: targetUser.id, status: { [Op.ne]: 'DELETED' } }, attributes: [[fn('sum', col('size')), 'total']], raw: true, });