File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
- /* eslint-disable no-unused-vars */
2
1
import models from 'models'
3
2
import ResponseError from 'modules/Response/ResponseError'
4
3
import useValidation from 'helpers/useValidation'
@@ -10,7 +9,8 @@ const { Role } = models
10
9
11
10
class RoleService {
12
11
/**
13
- * Get All Role
12
+ *
13
+ * @param req Request
14
14
*/
15
15
public static async getAll ( req : any ) {
16
16
const { includeCount, order, ...queryFind } = PluginSqlizeQuery . generate (
@@ -32,7 +32,8 @@ class RoleService {
32
32
}
33
33
34
34
/**
35
- * Get One Role
35
+ *
36
+ * @param id
36
37
*/
37
38
public static async getOne ( id : string ) {
38
39
const data = await Role . findByPk ( id )
@@ -45,7 +46,8 @@ class RoleService {
45
46
}
46
47
47
48
/**
48
- * Create Role
49
+ *
50
+ * @param formData
49
51
*/
50
52
public static async create ( formData : RoleAttributes ) {
51
53
const value = useValidation ( schema . create , formData )
@@ -55,7 +57,9 @@ class RoleService {
55
57
}
56
58
57
59
/**
58
- * Update Role By Id
60
+ *
61
+ * @param id
62
+ * @param formData
59
63
*/
60
64
public static async update ( id : string , formData : RoleAttributes ) {
61
65
const data = await this . getOne ( id )
@@ -71,7 +75,8 @@ class RoleService {
71
75
}
72
76
73
77
/**
74
- * Delete Role By Id
78
+ *
79
+ * @param id
75
80
*/
76
81
public static async delete ( id : string ) {
77
82
const data = await this . getOne ( id )
You can’t perform that action at this time.
0 commit comments