api-register return errors
This commit is contained in:
parent
c6266f7674
commit
1279d5ac17
@ -76,13 +76,13 @@ class RegisterController extends ApiController
|
||||
/** @var User $user */
|
||||
if ($user = $model->signup()) {
|
||||
$this->emailService->sendEmail(new RegistrationEmail($user));
|
||||
return [
|
||||
return $this->asJson([
|
||||
'id' => $user->id,
|
||||
];
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return $this->asJson(['errors' => $model->errors]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user