api-register return errors
This commit is contained in:
parent
c6266f7674
commit
1279d5ac17
@ -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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user