Browse Source

fix: attachment path correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
fa6f20957d
  1. 1
      packages/nocodb-nest/src/modules/attachments/attachments.controller.ts
  2. 11
      packages/nocodb-nest/src/modules/utils/utils.controller.ts
  3. 8
      packages/nocodb-nest/src/modules/utils/utils.service.ts

1
packages/nocodb-nest/src/modules/attachments/attachments.controller.ts

@ -70,7 +70,6 @@ export class AttachmentsController {
// ); // );
) )
@UseInterceptors( @UseInterceptors(
FilesInterceptor('files[]', null,{ FilesInterceptor('files[]', null,{
storage: multer.diskStorage({}), storage: multer.diskStorage({}),
// limits: { // limits: {

11
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'; import { UtilsService } from './utils.service';
@Controller() @Controller()
export class UtilsController { export class UtilsController {
constructor(private readonly utilsService: UtilsService) {} constructor(private readonly utilsService: UtilsService) {}
@Get('/api/v1/db/meta/nocodb/info') @Get('/api/v1/db/meta/nocodb/info')
info() { info(@Request() req) {
return this.utilsService.info(); return this.utilsService.info({
ncSiteUrl: req.ncSiteUrl,
});
} }
@Get('/api/v1/version') @Get('/api/v1/version')
version() { version() {
return this.utilsService.versionInfo(); return this.utilsService.versionInfo();
} }
} }

8
packages/nocodb-nest/src/modules/utils/utils.service.ts

@ -57,7 +57,9 @@ interface AllMeta {
@Injectable() @Injectable()
export class UtilsService { export class UtilsService {
async info() { async info(
{ncSiteUrl} : {ncSiteUrl: string},
) {
const projectHasAdmin = !(await User.isFirst()); const projectHasAdmin = !(await User.isFirst());
const result = { const result = {
authType: 'jwt', authType: 'jwt',
@ -73,7 +75,7 @@ export class UtilsService {
), ),
oneClick: !!process.env.NC_ONE_CLICK, oneClick: !!process.env.NC_ONE_CLICK,
connectToExternalDB: !process.env.NC_CONNECT_TO_EXTERNAL_DB_DISABLED, connectToExternalDB: !process.env.NC_CONNECT_TO_EXTERNAL_DB_DISABLED,
version: '', //packageVersion, version: packageVersion,
defaultLimit: Math.max( defaultLimit: Math.max(
Math.min( Math.min(
+process.env.DB_QUERY_LIMIT_DEFAULT || 25, +process.env.DB_QUERY_LIMIT_DEFAULT || 25,
@ -86,7 +88,7 @@ export class UtilsService {
teleEnabled: process.env.NC_DISABLE_TELE !== 'true', teleEnabled: process.env.NC_DISABLE_TELE !== 'true',
auditEnabled: process.env.NC_DISABLE_AUDIT !== 'true', auditEnabled: process.env.NC_DISABLE_AUDIT !== 'true',
// todo: tobe done // todo: tobe done
ncSiteUrl: '', ncSiteUrl,
// todo: tobe done // todo: tobe done
ee: false, // Noco.isEE(), ee: false, // Noco.isEE(),
ncAttachmentFieldSize: NC_ATTACHMENT_FIELD_SIZE, ncAttachmentFieldSize: NC_ATTACHMENT_FIELD_SIZE,

Loading…
Cancel
Save