File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ routes.delete(
64
64
Authorization ,
65
65
asyncHandler ( async function deleteData ( req : Request , res : Response ) {
66
66
const { id } = req . getParams ( )
67
- const { code, message } = await RoleService . delete ( id )
68
67
69
- return res . status ( 200 ) . json ( { code, message } )
68
+ await RoleService . delete ( id )
69
+ const buildResponse = BuildResponse . deleted ( { } )
70
+
71
+ return res . status ( 200 ) . json ( buildResponse )
70
72
} )
71
73
)
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import ResponseError from 'modules/Response/ResponseError'
4
4
import useValidation from 'helpers/useValidation'
5
5
import { RoleAttributes } from 'models/role'
6
6
import PluginSqlizeQuery from 'modules/SqlizeQuery/PluginSqlizeQuery'
7
- import BuildResponse from 'modules/Response/BuildResponse'
8
7
import schema from './schema'
9
8
10
9
const { Role } = models
@@ -79,8 +78,6 @@ class RoleService {
79
78
public static async delete ( id : string ) {
80
79
const data = await this . getOne ( id )
81
80
await data . destroy ( )
82
-
83
- return BuildResponse . deleted ( { } )
84
81
}
85
82
}
86
83
You can’t perform that action at this time.
0 commit comments