fix role assign in league creation
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good
Details
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good
Details
This commit is contained in:
parent
93df0e8ffd
commit
d36cee95e6
|
|
@ -44,10 +44,10 @@ class HandleCreateLeague
|
||||||
$leagueDto->validate();
|
$leagueDto->validate();
|
||||||
$leagueEntity = $this->leagueFactory::create($leagueDto);
|
$leagueEntity = $this->leagueFactory::create($leagueDto);
|
||||||
$leagueEntity->setActive(true);
|
$leagueEntity->setActive(true);
|
||||||
$this->assignPresidentRole($leagueEntity->getId(), $userEntity);
|
|
||||||
|
|
||||||
$this->entityManager->persist($leagueEntity);
|
$this->entityManager->persist($leagueEntity);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
$this->assignPresidentRole($leagueEntity->getId(), $userEntity);
|
||||||
|
|
||||||
$leagueDto->id = $leagueEntity->getId();
|
$leagueDto->id = $leagueEntity->getId();
|
||||||
$leagueDto->createdAt = $leagueEntity->getCreatedAt();
|
$leagueDto->createdAt = $leagueEntity->getCreatedAt();
|
||||||
|
|
@ -66,5 +66,6 @@ class HandleCreateLeague
|
||||||
$leaguePresidentRole->setEntityId($leagueId);
|
$leaguePresidentRole->setEntityId($leagueId);
|
||||||
$leaguePresidentRole->setUser($userEntity);
|
$leaguePresidentRole->setUser($userEntity);
|
||||||
$this->entityManager->persist($leaguePresidentRole);
|
$this->entityManager->persist($leaguePresidentRole);
|
||||||
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue