api-register return errors

This commit is contained in:
Денис Хорош 2023-12-28 15:29:01 +03:00
parent c6266f7674
commit 1279d5ac17

View File

@ -76,13 +76,13 @@ class RegisterController extends ApiController
/** @var User $user */ /** @var User $user */
if ($user = $model->signup()) { if ($user = $model->signup()) {
$this->emailService->sendEmail(new RegistrationEmail($user)); $this->emailService->sendEmail(new RegistrationEmail($user));
return [ return $this->asJson([
'id' => $user->id, 'id' => $user->id,
]; ]);
} }
} }
return null; return $this->asJson(['errors' => $model->errors]);
} }
/** /**