UNPKG

@tomei/sso

Version:
30 lines (27 loc) 787 B
import SystemPrivilegeModel from '../../models/system-privilege.entity'; import GroupPrivilegeModel from '../../models/group-privilege.entity'; import { RepositoryBase, IRepositoryBase } from '@tomei/general'; export class GroupPrivilegeRepository extends RepositoryBase<GroupPrivilegeModel> implements IRepositoryBase<GroupPrivilegeModel> { constructor() { super(GroupPrivilegeModel); } async delete( GroupCode: string, SystemPrivilegeId: string, dbTransaction?: any, ) { try { const data = await GroupPrivilegeModel.findOne({ where: { GroupCode, SystemPrivilegeId }, transaction: dbTransaction, }); data.destroy({ transaction: dbTransaction }); return data; } catch (error) { throw error; } } }