1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-05 10:18:38 +09:00

fix(backend): await user-specific drive capacity

This commit is contained in:
ltlapy 2022-07-14 20:45:23 +09:00
parent 4888fd26ce
commit 897fdf1012

View File

@ -35,11 +35,12 @@ export const paramDef = {
export default define(meta, paramDef, async (ps, user) => {
const instance = await fetchMeta(true);
// Calculate drive usage
// Calculate drive usage and capacity
const usage = await DriveFiles.calcDriveUsageOf(user.id);
const capacity = await user.driveCapacityOverrideMb || instance.localDriveCapacityMb;
return {
capacity: 1024 * 1024 * (user.driveCapacityOverrideMb || instance.localDriveCapacityMb),
capacity: 1024 * 1024 * capacity,
usage: usage,
};
});