UNPKG

@tomei/sso

Version:
26 lines (23 loc) 694 B
import UserPrivilegeModel from '../../models/user-privilege.entity'; import { RepositoryBase, IRepositoryBase } from '@tomei/general'; export class UserPrivilegeRepository extends RepositoryBase<UserPrivilegeModel> implements IRepositoryBase<UserPrivilegeModel> { constructor() { super(UserPrivilegeModel); } async delete(UserPrivilegeId: number, dbTransaction?: any) { try { const options = { where: { UserPrivilegeId: UserPrivilegeId, }, transaction: dbTransaction, }; await UserPrivilegeModel.destroy(options); } catch (error) { throw new Error(`An Error occured when delete : ${error.message}`); } } }