reseller : bug
This commit is contained in:
@@ -30,7 +30,7 @@ export class ResellerService {
|
||||
private readonly userBankAccountRepository: UserBankAccountRepository,
|
||||
private readonly walletsService: WalletsService,
|
||||
private readonly dataSource: DataSource,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Create a reseller record for an existing user.
|
||||
@@ -44,6 +44,16 @@ export class ResellerService {
|
||||
throw new BadRequestException(AuthMessage.USER_NOT_FOUND);
|
||||
}
|
||||
|
||||
const exsiting = await this.resellerRepository.findOne({
|
||||
where: {
|
||||
owner: { id: user.id }
|
||||
}
|
||||
})
|
||||
|
||||
if (exsiting) {
|
||||
throw new BadRequestException("شخص مورد نظر نمایندگی دارد .")
|
||||
}
|
||||
|
||||
const reseller = this.resellerRepository.create({
|
||||
name,
|
||||
owner: user,
|
||||
|
||||
Reference in New Issue
Block a user