Skip to content

Commit

Permalink
fix: controller role get all
Browse files Browse the repository at this point in the history
  • Loading branch information
masb0ymas committed Oct 17, 2020
1 parent eb93a1e commit a2631dd
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/controllers/Role/controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-unused-vars */
import { FilterQueryAttributes } from 'models'
import { Request, Response } from 'express'
import routes from 'routes/public'
import asyncHandler from 'helpers/asyncHandler'
Expand All @@ -13,20 +12,7 @@ const keyGetAll = `${APP_KEY_REDIS}_role:getAll`
routes.get(
'/role',
asyncHandler(async function getAll(req: Request, res: Response) {
const {
page,
pageSize,
filtered,
sorted,
}: FilterQueryAttributes = req.getQuery()

const { data, total } = await RoleService.getAll(
page,
pageSize,
filtered,
sorted
)

const { data, total } = await RoleService.getAll(req)
return res.status(200).json({ data, total })
})
)
Expand Down

0 comments on commit a2631dd

Please sign in to comment.