refactor: return data
This commit is contained in:
parent
b67a3d1b22
commit
627567abf6
1 changed files with 2 additions and 25 deletions
|
|
@ -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] : []));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue