From 9b76c805ec5d109e5cdfc4097c8c268afa1d3b58 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 25 Jan 2023 22:14:53 +0100 Subject: [PATCH] fix: DriveFile folder & user undefined instead of null when unrequested --- packages/backend/src/models/repositories/drive-file.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index f75207134..ce3e7b705 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -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, }); },