reseller : bug

This commit is contained in:
2026-04-18 16:26:46 +03:30
parent b369794d42
commit f8a66e9d42
+10
View File
@@ -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,