mirror of https://github.com/nocodb/nocodb
աɨռɢӄաօռɢ
2 years ago
committed by
GitHub
177 changed files with 10551 additions and 3660 deletions
File diff suppressed because it is too large
Load Diff
@ -1,91 +0,0 @@
|
||||
import { Router } from 'express'; |
||||
import { T } from 'nc-help'; |
||||
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||
import { hookFilterService } from '../services'; |
||||
import type { Request, Response } from 'express'; |
||||
|
||||
export async function filterGet(req: Request, res: Response) { |
||||
const filter = await hookFilterService.filterGet({ |
||||
hookId: req.params.hookId, |
||||
}); |
||||
|
||||
res.json(filter); |
||||
} |
||||
|
||||
export async function filterList(req: Request, res: Response) { |
||||
const filter = await hookFilterService.filterList({ |
||||
hookId: req.params.hookId, |
||||
}); |
||||
|
||||
res.json(filter); |
||||
} |
||||
|
||||
export async function filterChildrenRead(req: Request, res: Response) { |
||||
const filter = await hookFilterService.filterChildrenRead({ |
||||
hookId: req.params.hookId, |
||||
filterParentId: req.params.filterParentId, |
||||
}); |
||||
|
||||
res.json(filter); |
||||
} |
||||
|
||||
export async function filterCreate(req: Request<any, any>, res) { |
||||
const filter = await hookFilterService.filterCreate({ |
||||
filter: req.body, |
||||
hookId: req.params.hookId, |
||||
}); |
||||
|
||||
res.json(filter); |
||||
} |
||||
|
||||
export async function filterUpdate(req, res) { |
||||
const filter = await hookFilterService.filterUpdate({ |
||||
filterId: req.params.filterId, |
||||
filter: req.body, |
||||
hookId: req.params.hookId, |
||||
}); |
||||
|
||||
res.json(filter); |
||||
} |
||||
|
||||
export async function filterDelete(req: Request, res: Response) { |
||||
const filter = await hookFilterService.filterDelete({ |
||||
filterId: req.params.filterId, |
||||
}); |
||||
T.emit('evt', { evt_type: 'hookFilter:deleted' }); |
||||
res.json(filter); |
||||
} |
||||
|
||||
const router = Router({ mergeParams: true }); |
||||
router.get( |
||||
'/hooks/:hookId/filters/', |
||||
metaApiMetrics, |
||||
ncMetaAclMw(filterList, 'filterList') |
||||
); |
||||
router.post( |
||||
'/hooks/:hookId/filters/', |
||||
metaApiMetrics, |
||||
ncMetaAclMw(filterCreate, 'filterCreate') |
||||
); |
||||
router.get( |
||||
'/hooks/:hookId/filters/:filterId', |
||||
metaApiMetrics, |
||||
ncMetaAclMw(filterGet, 'filterGet') |
||||
); |
||||
router.patch( |
||||
'/hooks/:hookId/filters/:filterId', |
||||
metaApiMetrics, |
||||
ncMetaAclMw(filterUpdate, 'filterUpdate') |
||||
); |
||||
router.delete( |
||||
'/hooks/:hookId/filters/:filterId', |
||||
metaApiMetrics, |
||||
ncMetaAclMw(filterDelete, 'filterDelete') |
||||
); |
||||
router.get( |
||||
'/hooks/:hookId/filters/:filterParentId/children', |
||||
metaApiMetrics, |
||||
ncMetaAclMw(filterChildrenRead, 'filterChildrenRead') |
||||
); |
||||
export default router; |
@ -1,6 +1,5 @@
|
||||
export { DbFactory } from './lib/DbFactory'; |
||||
export { BaseModelSql } from './lib/sql/BaseModelSql'; |
||||
|
||||
import XKnex, { Knex } from './lib/sql/CustomKnex'; |
||||
|
||||
export { DbFactory } from './lib/DbFactory'; |
||||
export { BaseModelSql } from './lib/sql/BaseModelSql'; |
||||
export { XKnex, Knex }; |
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue