reseller : bug
This commit is contained in:
@@ -44,6 +44,16 @@ export class ResellerService {
|
|||||||
throw new BadRequestException(AuthMessage.USER_NOT_FOUND);
|
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({
|
const reseller = this.resellerRepository.create({
|
||||||
name,
|
name,
|
||||||
owner: user,
|
owner: user,
|
||||||
|
|||||||
Reference in New Issue
Block a user