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(
FilesInterceptor('files[]', null,{
storage: multer.diskStorage({}),
// 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';
@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();
}
}

8
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,

Loading…
Cancel
Save