forked from FoundKeyGang/FoundKey
server: always use user id for calcDriveUsageOf
This commit is contained in:
parent
79ddbafd0d
commit
61a2db49df
3 changed files with 2 additions and 3 deletions
|
@ -35,7 +35,6 @@ export const paramDef = {
|
|||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const instance = await fetchMeta(true);
|
||||
|
||||
// Calculate drive usage
|
||||
const usage = await DriveFiles.calcDriveUsageOf(user.id);
|
||||
|
||||
return {
|
||||
|
|
|
@ -177,7 +177,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
|||
driveFilesCount: DriveFiles.createQueryBuilder('file')
|
||||
.where('file.userId = :userId', { userId: user.id })
|
||||
.getCount(),
|
||||
driveUsage: DriveFiles.calcDriveUsageOf(user),
|
||||
driveUsage: DriveFiles.calcDriveUsageOf(user.id),
|
||||
});
|
||||
|
||||
result.followingCount = result.localFollowingCount + result.remoteFollowingCount;
|
||||
|
|
|
@ -372,7 +372,7 @@ export async function addFile({
|
|||
|
||||
//#region Check drive usage
|
||||
if (user && !isLink) {
|
||||
const usage = await DriveFiles.calcDriveUsageOf(user);
|
||||
const usage = await DriveFiles.calcDriveUsageOf(user.id);
|
||||
|
||||
const instance = await fetchMeta();
|
||||
const driveCapacity = 1024 * 1024 * (Users.isLocalUser(user) ? instance.localDriveCapacityMb : instance.remoteDriveCapacityMb);
|
||||
|
|
Loading…
Reference in a new issue