@@ -3,7 +3,7 @@ import { Request, Response } from 'express'
3
3
import routes from 'routes/public'
4
4
import asyncHandler from 'helpers/asyncHandler'
5
5
import Authorization from 'middlewares/Authorization'
6
- import ResponseSuccess from 'modules/Response/BuildResponse'
6
+ import BuildResponse from 'modules/Response/BuildResponse'
7
7
import RoleService from './service'
8
8
9
9
const { APP_KEY_REDIS } = process . env
@@ -14,7 +14,7 @@ routes.get(
14
14
'/role' ,
15
15
asyncHandler ( async function getAll ( req : Request , res : Response ) {
16
16
const { message, data, total } = await RoleService . getAll ( req )
17
- const buildResponse = ResponseSuccess . get ( { message, data, total } )
17
+ const buildResponse = BuildResponse . get ( { message, data, total } )
18
18
19
19
return res . status ( 200 ) . json ( buildResponse )
20
20
} )
@@ -26,7 +26,7 @@ routes.get(
26
26
const { id } = req . getParams ( )
27
27
28
28
const data = await RoleService . getOne ( id )
29
- const buildResponse = ResponseSuccess . get ( { data } )
29
+ const buildResponse = BuildResponse . get ( { data } )
30
30
31
31
return res . status ( 200 ) . json ( buildResponse )
32
32
} )
@@ -39,7 +39,7 @@ routes.post(
39
39
const formData = req . getBody ( )
40
40
41
41
const data = await RoleService . create ( formData )
42
- const buildResponse = ResponseSuccess . created ( { data } )
42
+ const buildResponse = BuildResponse . created ( { data } )
43
43
44
44
return res . status ( 201 ) . json ( buildResponse )
45
45
} )
@@ -53,7 +53,7 @@ routes.put(
53
53
const formData = req . getBody ( )
54
54
55
55
const data = await RoleService . update ( id , formData )
56
- const buildResponse = ResponseSuccess . updated ( { data } )
56
+ const buildResponse = BuildResponse . updated ( { data } )
57
57
58
58
return res . status ( 200 ) . json ( buildResponse )
59
59
} )
0 commit comments