Browse Source

fix: corrections (WIP)

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 1 year ago
parent
commit
9c091cd576
  1. 26
      packages/nocodb-nest/src/modules/attachments/attachments.controller.ts
  2. 2
      packages/nocodb-nest/src/modules/hooks/hooks.controller.ts
  3. 2
      packages/nocodb-nest/src/modules/hooks/hooks.service.ts
  4. 2
      packages/nocodb-nest/src/modules/import/import.controller.ts
  5. 2
      packages/nocodb-nest/src/modules/org-tokens/org-tokens.module.ts
  6. 3
      packages/nocodb-nest/src/modules/org-users/org-users.module.ts
  7. 3
      packages/nocodb-nest/src/modules/users/users.module.ts

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

@ -2,6 +2,7 @@ import {
Body,
Controller,
Get,
Param,
Post,
Query,
Request,
@ -89,12 +90,15 @@ export class AttachmentsController {
return attachments;
}
@Get(/^\/download\/(.+)$/)
// @Get(/^\/download\/(.+)$/)
// , getCacheMiddleware(), catchError(fileRead));
async fileRead(req, res) {
@Get('/download/:filename(*)')
// This route will match any URL that starts with
async fileRead(@Param('filename') filename: string
, @Response() res) {
try {
const { img, type } = await this.attachmentsService.fileRead({
path: path.join('nc', 'uploads', req.params?.[0]),
path: path.join('nc', 'uploads', filename),
});
res.writeHead(200, { 'Content-Type': type });
@ -105,17 +109,23 @@ export class AttachmentsController {
}
}
@Get(/^\/dl\/([^/]+)\/([^/]+)\/(.+)$/)
// @Get(/^\/dl\/([^/]+)\/([^/]+)\/(.+)$/)
@Get('/dl/:param1([a-zA-Z0-9_-]+)/:param2([a-zA-Z0-9_-]+)/:filename(*)')
// getCacheMiddleware(),
async fileReadv2(@Request() req, @Response() res) {
async fileReadv2(
@Param('param1') param1: string,
@Param('param2') param2: string,
@Param('filename') filename: string,
@Response() res,
) {
try {
const { img, type } = await this.attachmentsService.fileRead({
path: path.join(
'nc',
req.params[0],
req.params[1],
param1,
param2,
'uploads',
...req.params[2].split('/'),
...filename.split('/'),
),
});

2
packages/nocodb-nest/src/modules/hooks/hooks.controller.ts

@ -83,7 +83,7 @@ export class HooksController {
async tableSampleData(
@Param('tableId') tableId: string,
@Param('operation') operation: HookType['operation'],
@Param('version') version: HookType['version'],
@Param('version') version: any //HookType['version'],
) {
return;
await this.hooksService.tableSampleData({

2
packages/nocodb-nest/src/modules/hooks/hooks.service.ts

@ -103,7 +103,7 @@ export class HooksService {
async tableSampleData(param: {
tableId: string;
operation: HookType['operation'];
version: HookType['version'];
version: any// HookType['version'];
}) {
const model = await Model.getByIdOrName({ id: param.tableId });

2
packages/nocodb-nest/src/modules/import/import.controller.ts

@ -25,7 +25,7 @@ export default (
// add importer job handler and progress notification job handler
NocoJobs.jobsMgr.addJobWorker(
AIRTABLE_IMPORT_JOB,
this.syncService.airtableImportJob!,
{} as any // this?.syncService?.airtableImportJob,
);
NocoJobs.jobsMgr.addJobWorker(
AIRTABLE_PROGRESS_JOB,

2
packages/nocodb-nest/src/modules/org-tokens/org-tokens.module.ts

@ -5,6 +5,6 @@ import { OrgTokensController } from './org-tokens.controller';
@Module({
controllers: [OrgTokensController],
providers: [OrgTokensEeService]
providers: [OrgTokensEeService, OrgTokensService]
})
export class OrgTokensModule {}

3
packages/nocodb-nest/src/modules/org-users/org-users.module.ts

@ -1,9 +1,10 @@
import { Module } from '@nestjs/common';
import { ProjectUsersService } from '../project-users/project-users.service'
import { OrgUsersService } from './org-users.service';
import { OrgUsersController } from './org-users.controller';
@Module({
controllers: [OrgUsersController],
providers: [OrgUsersService]
providers: [OrgUsersService, ProjectUsersService]
})
export class OrgUsersModule {}

3
packages/nocodb-nest/src/modules/users/users.module.ts

@ -1,4 +1,5 @@
import { Module } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt'
import { Connection } from '../../connection/connection'
import { MetaService } from '../../meta/meta.service'
import { UsersService } from './users.service';
@ -6,7 +7,7 @@ import { UsersController } from './users.controller';
@Module({
controllers: [UsersController],
providers: [UsersService, MetaService, Connection],
providers: [UsersService, MetaService, Connection, JwtService],
exports: [UsersService, Connection, MetaService],
})
export class UsersModule {}

Loading…
Cancel
Save