Browse Source

refactor(nocodb): lint

pull/5773/head
Wing-Kam Wong 1 year ago
parent
commit
62da4c15a1
  1. 1
      packages/nocodb/src/controllers/org-users.controller.ts
  2. 2
      packages/nocodb/src/controllers/projects.controller.ts
  3. 6
      packages/nocodb/src/controllers/users/users.controller.ts
  4. 8
      packages/nocodb/src/db/BaseModelSqlv2.ts
  5. 1
      packages/nocodb/src/middlewares/extract-project-id/extract-project-id.middleware.ts
  6. 1
      packages/nocodb/src/models/Model.ts

1
packages/nocodb/src/controllers/org-users.controller.ts

@ -10,7 +10,6 @@ import {
Request, Request,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { OrgUserRoles } from 'nocodb-sdk'; import { OrgUserRoles } from 'nocodb-sdk';
import { GlobalGuard } from '../guards/global/global.guard'; import { GlobalGuard } from '../guards/global/global.guard';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';

2
packages/nocodb/src/controllers/projects.controller.ts

@ -16,8 +16,8 @@ import { ProjectReqType } from 'nocodb-sdk';
import { GlobalGuard } from '../guards/global/global.guard'; import { GlobalGuard } from '../guards/global/global.guard';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import { import {
ExtractProjectIdMiddleware,
Acl, Acl,
ExtractProjectIdMiddleware,
} from '../middlewares/extract-project-id/extract-project-id.middleware'; } from '../middlewares/extract-project-id/extract-project-id.middleware';
import Noco from '../Noco'; import Noco from '../Noco';
import { packageVersion } from '../utils/packageVersion'; import { packageVersion } from '../utils/packageVersion';

6
packages/nocodb/src/controllers/users/users.controller.ts

@ -94,7 +94,7 @@ export class UsersController {
@Get('/auth/google') @Get('/auth/google')
@UseGuards(AuthGuard('google')) @UseGuards(AuthGuard('google'))
googleAuthenticate(@Request() req) { googleAuthenticate() {
// google strategy will take care the request // google strategy will take care the request
} }
@ -116,7 +116,7 @@ export class UsersController {
@UseGuards(GlobalGuard) @UseGuards(GlobalGuard)
@Acl('passwordChange') @Acl('passwordChange')
@HttpCode(200) @HttpCode(200)
async passwordChange(@Request() req: any, @Body() body: any): Promise<any> { async passwordChange(@Request() req: any): Promise<any> {
if (!(req as any).isAuthenticated()) { if (!(req as any).isAuthenticated()) {
NcError.forbidden('Not allowed'); NcError.forbidden('Not allowed');
} }
@ -136,7 +136,7 @@ export class UsersController {
'/api/v1/auth/password/forgot', '/api/v1/auth/password/forgot',
]) ])
@HttpCode(200) @HttpCode(200)
async passwordForgot(@Request() req: any, @Body() body: any): Promise<any> { async passwordForgot(@Request() req: any): Promise<any> {
await this.usersService.passwordForgot({ await this.usersService.passwordForgot({
siteUrl: (req as any).ncSiteUrl, siteUrl: (req as any).ncSiteUrl,
body: req.body, body: req.body,

8
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -48,7 +48,7 @@ import type {
SelectOption, SelectOption,
} from '../models'; } from '../models';
import type { Knex } from 'knex'; import type { Knex } from 'knex';
import type { BoolType, SortType } from 'nocodb-sdk'; import type { SortType } from 'nocodb-sdk';
dayjs.extend(utc); dayjs.extend(utc);
dayjs.extend(timezone); dayjs.extend(timezone);
@ -1352,12 +1352,6 @@ class BaseModelSqlv2 {
const columns = await this.model.getColumns(); const columns = await this.model.getColumns();
for (const column of columns) { for (const column of columns) {
switch (column.uidt) { switch (column.uidt) {
case UITypes.Rollup:
{
// @ts-ignore
const colOptions: RollupColumn = await column.getColOptions();
}
break;
case UITypes.Lookup: case UITypes.Lookup:
{ {
// @ts-ignore // @ts-ignore

1
packages/nocodb/src/middlewares/extract-project-id/extract-project-id.middleware.ts

@ -212,7 +212,6 @@ export class AclMiddleware implements NestInterceptor {
); );
const req = context.switchToHttp().getRequest(); const req = context.switchToHttp().getRequest();
const res = context.switchToHttp().getResponse();
req.customProperty = 'This is a custom property'; req.customProperty = 'This is a custom property';
const roles: Record<string, boolean> = extractRolesObj(req.user?.roles); const roles: Record<string, boolean> = extractRolesObj(req.user?.roles);

1
packages/nocodb/src/models/Model.ts

@ -16,7 +16,6 @@ import { sanitize } from '../helpers/sqlSanitize';
import { extractProps } from '../helpers/extractProps'; import { extractProps } from '../helpers/extractProps';
import Audit from './Audit'; import Audit from './Audit';
import View from './View'; import View from './View';
import Base from './Base';
import Column from './Column'; import Column from './Column';
import type { BoolType, TableReqType, TableType } from 'nocodb-sdk'; import type { BoolType, TableReqType, TableType } from 'nocodb-sdk';
import type { XKnex } from '../db/CustomKnex'; import type { XKnex } from '../db/CustomKnex';

Loading…
Cancel
Save