Browse Source

refactor : code

pull/5261/head
Naveen MR 2 years ago
parent
commit
349648c6da
  1. 6
      packages/nocodb/src/lib/controllers/views/formView.ctl.ts
  2. 6
      packages/nocodb/src/lib/controllers/views/formViewColumn.ctl.ts
  3. 6
      packages/nocodb/src/lib/controllers/views/galleryView.ctl.ts
  4. 6
      packages/nocodb/src/lib/controllers/views/gridView.ctl.ts
  5. 6
      packages/nocodb/src/lib/controllers/views/gridViewColumn.ctl.ts
  6. 8
      packages/nocodb/src/lib/controllers/views/kanbanView.ctl.ts
  7. 6
      packages/nocodb/src/lib/controllers/views/mapView.ctl.ts
  8. 14
      packages/nocodb/src/lib/meta/api/index.ts

6
packages/nocodb/src/lib/controllers/formView.ctl.ts → packages/nocodb/src/lib/controllers/views/formView.ctl.ts

@ -1,8 +1,8 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import { FormType } from 'nocodb-sdk'; import { FormType } from 'nocodb-sdk';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
import { formViewService } from '../services'; import { formViewService } from '../../services';
export async function formViewGet(req: Request, res: Response<FormType>) { export async function formViewGet(req: Request, res: Response<FormType>) {
const formViewData = await formViewService.formViewGet({ const formViewData = await formViewService.formViewGet({

6
packages/nocodb/src/lib/controllers/formViewColumn.ctl.ts → packages/nocodb/src/lib/controllers/views/formViewColumn.ctl.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
import { formViewColumnService } from '../services'; import { formViewColumnService } from '../../services';
export async function columnUpdate(req: Request, res: Response) { export async function columnUpdate(req: Request, res: Response) {
res.json( res.json(

6
packages/nocodb/src/lib/controllers/galleryView.ctl.ts → packages/nocodb/src/lib/controllers/views/galleryView.ctl.ts

@ -1,8 +1,8 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import { GalleryType } from 'nocodb-sdk'; import { GalleryType } from 'nocodb-sdk';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
import { galleryViewService } from '../services'; import { galleryViewService } from '../../services';
export async function galleryViewGet(req: Request, res: Response<GalleryType>) { export async function galleryViewGet(req: Request, res: Response<GalleryType>) {
res.json( res.json(

6
packages/nocodb/src/lib/controllers/gridView.ctl.ts → packages/nocodb/src/lib/controllers/views/gridView.ctl.ts

@ -1,7 +1,7 @@
import { Request, Router } from 'express'; import { Request, Router } from 'express';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
import { gridViewService } from '../services'; import { gridViewService } from '../../services';
export async function gridViewCreate(req: Request<any>, res) { export async function gridViewCreate(req: Request<any>, res) {
const view = await gridViewService.gridViewCreate({ const view = await gridViewService.gridViewCreate({

6
packages/nocodb/src/lib/controllers/gridViewColumn.ctl.ts → packages/nocodb/src/lib/controllers/views/gridViewColumn.ctl.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
import { gridViewColumnService } from '../services'; import { gridViewColumnService } from '../../services';
export async function columnList(req: Request, res: Response) { export async function columnList(req: Request, res: Response) {
res.json( res.json(

8
packages/nocodb/src/lib/controllers/kanbanView.ctl.ts → packages/nocodb/src/lib/controllers/views/kanbanView.ctl.ts

@ -1,10 +1,10 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import { KanbanType, ViewTypes } from 'nocodb-sdk'; import { KanbanType, ViewTypes } from 'nocodb-sdk';
import View from '../models/View'; import View from '../../models/View';
import KanbanView from '../models/KanbanView'; import KanbanView from '../../models/KanbanView';
import { T } from 'nc-help'; import { T } from 'nc-help';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
// todo: map to service // todo: map to service

6
packages/nocodb/src/lib/controllers/mapView.ctl.ts → packages/nocodb/src/lib/controllers/views/mapView.ctl.ts

@ -1,8 +1,8 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import { MapType } from 'nocodb-sdk'; import { MapType } from 'nocodb-sdk';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; import { metaApiMetrics } from '../../meta/helpers/apiMetrics';
import { mapViewService } from '../services'; import { mapViewService } from '../../services';
export async function mapViewGet(req: Request, res: Response<MapType>) { export async function mapViewGet(req: Request, res: Response<MapType>) {
res.json( res.json(

14
packages/nocodb/src/lib/meta/api/index.ts

@ -10,18 +10,18 @@ import { Router } from 'express';
import sortController from '../../controllers/sort.ctl'; import sortController from '../../controllers/sort.ctl';
import filterController from '../../controllers/filter.ctl'; import filterController from '../../controllers/filter.ctl';
import viewColumnController from '../../controllers/viewColumn.ctl'; import viewColumnController from '../../controllers/viewColumn.ctl';
import gridViewController from '../../controllers/gridView.ctl'; import gridViewController from '../../controllers/views/gridView.ctl';
import viewController from '../../controllers/view.ctl'; import viewController from '../../controllers/view.ctl';
import galleryViewController from '../../controllers/galleryView.ctl'; import galleryViewController from '../../controllers/views/galleryView.ctl';
import formViewController from '../../controllers/formView.ctl'; import formViewController from '../../controllers/views/formView.ctl';
import formViewColumnController from '../../controllers/formViewColumn.ctl'; import formViewColumnController from '../../controllers/views/formViewColumn.ctl';
import attachmentController from '../../controllers/attachment.ctl'; import attachmentController from '../../controllers/attachment.ctl';
import exportController from '../../controllers/export.ctl'; import exportController from '../../controllers/export.ctl';
import auditController from '../../controllers/audit.ctl'; import auditController from '../../controllers/audit.ctl';
import hookController from '../../controllers/hook.ctl'; import hookController from '../../controllers/hook.ctl';
import pluginController from '../../controllers/plugin.ctl'; import pluginController from '../../controllers/plugin.ctl';
import gridViewColumnController from '../../controllers/gridViewColumn.ctl'; import gridViewColumnController from '../../controllers/views/gridViewColumn.ctl';
import kanbanViewController from '../../controllers/kanbanView.ctl'; import kanbanViewController from '../../controllers/views/kanbanView.ctl';
import { userController } from '../../controllers/user'; import { userController } from '../../controllers/user';
// import extractProjectIdAndAuthenticate from './helpers/extractProjectIdAndAuthenticate'; // import extractProjectIdAndAuthenticate from './helpers/extractProjectIdAndAuthenticate';
import utilController from '../../controllers/util.ctl'; import utilController from '../../controllers/util.ctl';
@ -54,7 +54,7 @@ import crypto from 'crypto';
import swaggerController from '../../controllers/apiDocs'; import swaggerController from '../../controllers/apiDocs';
import importController from '../../controllers/sync/importApis'; import importController from '../../controllers/sync/importApis';
import syncSourceController from '../../controllers/sync'; import syncSourceController from '../../controllers/sync';
import mapViewController from '../../controllers/mapView.ctl'; import mapViewController from '../../controllers/views/mapView.ctl';
const clients: { [id: string]: Socket } = {}; const clients: { [id: string]: Socket } = {};
const jobs: { [id: string]: { last_message: any } } = {}; const jobs: { [id: string]: { last_message: any } } = {};

Loading…
Cancel
Save