Include relationships in login response
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good
This commit is contained in:
@@ -16,6 +16,7 @@ class UserDto
|
||||
public string $profilePicture;
|
||||
public \DateTimeInterface $birthday;
|
||||
public array $noteList;
|
||||
public bool $privacyPolicy;
|
||||
public bool $active;
|
||||
public array $receivedNotificationDtoList;
|
||||
public array $validationErrors;
|
||||
@@ -91,6 +92,10 @@ class UserDto
|
||||
{
|
||||
$this->phone = $userObj->getPhone();
|
||||
}
|
||||
if ($userObj->isPrivacyPolicy() !== null)
|
||||
{
|
||||
$this->privacyPolicy = $userObj->isPrivacyPolicy();
|
||||
}
|
||||
if ($userObj->getProfilePicture() !== null)
|
||||
{
|
||||
$this->profilePicture = $userObj->getProfilePicture();
|
||||
@@ -156,6 +161,10 @@ class UserDto
|
||||
{
|
||||
$this->active = $dataList['active'];
|
||||
}
|
||||
if (isset($dataList['privacyPolicy']))
|
||||
{
|
||||
$this->privacyPolicy = $dataList['privacyPolicy'];
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(): void
|
||||
@@ -176,6 +185,14 @@ class UserDto
|
||||
{
|
||||
$this->validationErrors[] = 'El apellido no puede estar vacío';
|
||||
}
|
||||
if (empty($this->privacyPolicy))
|
||||
{
|
||||
$this->validationErrors[] = 'No puedes crear cuenta sin aceptar los términos y condiciones';
|
||||
}
|
||||
if (!$this->privacyPolicy)
|
||||
{
|
||||
$this->validationErrors[] = 'No puedes crear cuenta sin aceptar los términos y condiciones';
|
||||
}
|
||||
if (strlen($this->phone) !== 9)
|
||||
{
|
||||
$this->validationErrors[] = 'El número de teléfono debe tener 9 dígitos.';
|
||||
|
||||
Reference in New Issue
Block a user