permission update
This commit is contained in:
parent
9808100d81
commit
6865507545
6 changed files with 100 additions and 5 deletions
|
@ -3,6 +3,23 @@ import { role } from "../entity/role";
|
|||
import InternalException from "../exceptions/internalException";
|
||||
|
||||
export default abstract class RoleService {
|
||||
/**
|
||||
* @description get roles
|
||||
* @returns {Promise<Array<role>>}
|
||||
*/
|
||||
static async getAll(): Promise<Array<role>> {
|
||||
return await dataSource
|
||||
.getRepository(role)
|
||||
.createQueryBuilder("role")
|
||||
.getMany()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new InternalException("roles not found");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description get role by id
|
||||
* @param id number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue