fix: DriveFile folder & user undefined instead of null when unrequested

This commit is contained in:
Johann150 2023-01-25 22:14:53 +01:00
parent 21b20920c2
commit 9b76c805ec
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -108,9 +108,9 @@ export const DriveFileRepository = db.getRepository(DriveFile).extend({
folderId: file.folderId,
folder: opts.detail && file.folderId ? DriveFolders.pack(file.folderId, {
detail: true,
}) : null,
userId: opts.withUser ? file.userId : null,
user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null,
}) : undefined,
userId: file.userId,
user: (opts.withUser && file.userId) ? Users.pack(file.userId) : undefined,
});
},