|
|
@ -6,20 +6,19 @@ import { sortService } from '../services'; |
|
|
|
import type { SortListType, SortReqType } from 'nocodb-sdk'; |
|
|
|
import type { SortListType, SortReqType } from 'nocodb-sdk'; |
|
|
|
import type { Request, Response } from 'express'; |
|
|
|
import type { Request, Response } from 'express'; |
|
|
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
export async function sortList( |
|
|
|
export async function sortList( |
|
|
|
req: Request<any, any, any>, |
|
|
|
req: Request<any, any, any>, |
|
|
|
res: Response<SortListType> |
|
|
|
res: Response<SortListType> |
|
|
|
) { |
|
|
|
) { |
|
|
|
const sortList = await sortService.sortList({ |
|
|
|
res.json( |
|
|
|
|
|
|
|
new PagedResponseImpl( |
|
|
|
|
|
|
|
await sortService.sortList({ |
|
|
|
viewId: req.params.viewId, |
|
|
|
viewId: req.params.viewId, |
|
|
|
}); |
|
|
|
}) |
|
|
|
res.json({ |
|
|
|
) |
|
|
|
sorts: new PagedResponseImpl(sortList), |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
export async function sortCreate(req: Request<any, any, SortReqType>, res) { |
|
|
|
export async function sortCreate(req: Request<any, any, SortReqType>, res) { |
|
|
|
const sort = await sortService.sortCreate({ |
|
|
|
const sort = await sortService.sortCreate({ |
|
|
|
sort: req.body, |
|
|
|
sort: req.body, |
|
|
@ -42,6 +41,7 @@ export async function sortDelete(req: Request, res: Response) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
res.json(sort); |
|
|
|
res.json(sort); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export async function sortGet(req: Request, res: Response) { |
|
|
|
export async function sortGet(req: Request, res: Response) { |
|
|
|
const sort = await sortService.sortGet({ |
|
|
|
const sort = await sortService.sortGet({ |
|
|
|
sortId: req.params.sortId, |
|
|
|
sortId: req.params.sortId, |
|
|
|