Skip to content

Commit 4b6ff35

Browse files
committed
fix: role service
1 parent 4cd506a commit 4b6ff35

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/controllers/Role/service.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-unused-vars */
21
import models from 'models'
32
import ResponseError from 'modules/Response/ResponseError'
43
import useValidation from 'helpers/useValidation'
@@ -10,7 +9,8 @@ const { Role } = models
109

1110
class RoleService {
1211
/**
13-
* Get All Role
12+
*
13+
* @param req Request
1414
*/
1515
public static async getAll(req: any) {
1616
const { includeCount, order, ...queryFind } = PluginSqlizeQuery.generate(
@@ -32,7 +32,8 @@ class RoleService {
3232
}
3333

3434
/**
35-
* Get One Role
35+
*
36+
* @param id
3637
*/
3738
public static async getOne(id: string) {
3839
const data = await Role.findByPk(id)
@@ -45,7 +46,8 @@ class RoleService {
4546
}
4647

4748
/**
48-
* Create Role
49+
*
50+
* @param formData
4951
*/
5052
public static async create(formData: RoleAttributes) {
5153
const value = useValidation(schema.create, formData)
@@ -55,7 +57,9 @@ class RoleService {
5557
}
5658

5759
/**
58-
* Update Role By Id
60+
*
61+
* @param id
62+
* @param formData
5963
*/
6064
public static async update(id: string, formData: RoleAttributes) {
6165
const data = await this.getOne(id)
@@ -71,7 +75,8 @@ class RoleService {
7175
}
7276

7377
/**
74-
* Delete Role By Id
78+
*
79+
* @param id
7580
*/
7681
public static async delete(id: string) {
7782
const data = await this.getOne(id)

0 commit comments

Comments
 (0)