From 627567abf600894c4a8ec105bdd9251b864e0240 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:13:19 +0700 Subject: [PATCH] refactor: return data --- .../server/src/controllers/fileController.ts | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/Prototype/server/src/controllers/fileController.ts b/Prototype/server/src/controllers/fileController.ts index 3e5081c..34e61fa 100644 --- a/Prototype/server/src/controllers/fileController.ts +++ b/Prototype/server/src/controllers/fileController.ts @@ -113,7 +113,6 @@ export class FileController extends Controller { @Get("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file") @Tags("File") - @Security("bearerAuth") @SuccessResponse(HttpStatusCode.OK) public async getFile( @Path() cabinetName: string, @@ -138,31 +137,9 @@ export class FileController extends Controller { .map((v) => { if (!v._source) return; - const { - pathname, - title, - description, - keyword, - category, - attachment, - createdAt, - createdBy, - updatedAt, - updatedBy, - } = v._source; + const { attachment, ...rest } = v._source; - return { - pathname, - title, - description, - keyword, - category, - type: attachment["content_type"], - createdAt, - createdBy, - updatedAt, - updatedBy, - }; + return rest; }) .flatMap((v) => (v ? [v] : []));