From fa6f20957d93cc1fba429a667d7752a1e65c296d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 10 Apr 2023 23:06:27 +0530 Subject: [PATCH] fix: attachment path correction Signed-off-by: Pranav C --- .../src/modules/attachments/attachments.controller.ts | 1 - .../nocodb-nest/src/modules/utils/utils.controller.ts | 11 +++++------ .../nocodb-nest/src/modules/utils/utils.service.ts | 8 +++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts b/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts index e907c7ccf2..802cf72523 100644 --- a/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts +++ b/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts @@ -70,7 +70,6 @@ export class AttachmentsController { // ); ) @UseInterceptors( - FilesInterceptor('files[]', null,{ storage: multer.diskStorage({}), // limits: { diff --git a/packages/nocodb-nest/src/modules/utils/utils.controller.ts b/packages/nocodb-nest/src/modules/utils/utils.controller.ts index c04e7cdfe1..32ffe2a71a 100644 --- a/packages/nocodb-nest/src/modules/utils/utils.controller.ts +++ b/packages/nocodb-nest/src/modules/utils/utils.controller.ts @@ -1,20 +1,19 @@ -import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { Controller, Get, Request } from '@nestjs/common'; import { UtilsService } from './utils.service'; @Controller() export class UtilsController { constructor(private readonly utilsService: UtilsService) {} - @Get('/api/v1/db/meta/nocodb/info') - info() { - return this.utilsService.info(); + info(@Request() req) { + return this.utilsService.info({ + ncSiteUrl: req.ncSiteUrl, + }); } - @Get('/api/v1/version') version() { return this.utilsService.versionInfo(); } - } diff --git a/packages/nocodb-nest/src/modules/utils/utils.service.ts b/packages/nocodb-nest/src/modules/utils/utils.service.ts index 9f164dec8b..4f1157b6e8 100644 --- a/packages/nocodb-nest/src/modules/utils/utils.service.ts +++ b/packages/nocodb-nest/src/modules/utils/utils.service.ts @@ -57,7 +57,9 @@ interface AllMeta { @Injectable() export class UtilsService { - async info() { + async info( + {ncSiteUrl} : {ncSiteUrl: string}, + ) { const projectHasAdmin = !(await User.isFirst()); const result = { authType: 'jwt', @@ -73,7 +75,7 @@ export class UtilsService { ), oneClick: !!process.env.NC_ONE_CLICK, connectToExternalDB: !process.env.NC_CONNECT_TO_EXTERNAL_DB_DISABLED, - version: '', //packageVersion, + version: packageVersion, defaultLimit: Math.max( Math.min( +process.env.DB_QUERY_LIMIT_DEFAULT || 25, @@ -86,7 +88,7 @@ export class UtilsService { teleEnabled: process.env.NC_DISABLE_TELE !== 'true', auditEnabled: process.env.NC_DISABLE_AUDIT !== 'true', // todo: tobe done - ncSiteUrl: '', + ncSiteUrl, // todo: tobe done ee: false, // Noco.isEE(), ncAttachmentFieldSize: NC_ATTACHMENT_FIELD_SIZE,