feat(profile): enhance national_code uniqueness error message with masked mobile number
This commit is contained in:
@@ -149,9 +149,10 @@ class PatientController extends BaseController
|
||||
if ($nationalCode !== '') {
|
||||
$owner = $this->profileRepo->findOneByNationalCode($nationalCode);
|
||||
if ($owner !== null && ($patient === null || $owner->getUser()->getId() !== $patient->getId())) {
|
||||
$masked = \App\Shared\Service\InputValidator::maskMobile($owner->getUser()->getMobileNumber());
|
||||
return $this->error(
|
||||
ErrorCodes::ERR_PROFILE_NATIONAL_CODE_TAKEN,
|
||||
'این کد ملی قبلاً برای کاربر دیگری ثبت شده است',
|
||||
"این کد ملی قبلاً با شماره {$masked} ثبت شده است",
|
||||
409,
|
||||
'national_code'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user