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:
parent
4888fd26ce
commit
897fdf1012
@ -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,
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user