Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter not activated LPAs 2.0 #1064

Merged
168 changes: 167 additions & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions service-api/app/src/App/src/Service/Lpa/LpaAlreadyAdded.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ public function __construct(
public function __invoke(string $userId, string $lpaUid): ?array
{
if (($this->featureEnabled)('save_older_lpa_requests')) {

$savedLpaRecords = $this->userLpaActorMapRepository->getUsersLpas($userId);

foreach($savedLpaRecords as $record) {
foreach ($savedLpaRecords as $record) {
if ($record['SiriusUid'] === $lpaUid && !array_key_exists('ActivateBy', $record)) {
$lpa = $this->lpaService->getByUserLpaActorToken($record['Id'], $userId);

Expand Down Expand Up @@ -80,7 +79,6 @@ public function __invoke(string $userId, string $lpaUid): ?array
}

return null;

} else {
return $this->preSaveOfRequestFeature($userId, $lpaUid);
}
Expand All @@ -95,7 +93,7 @@ public function __invoke(string $userId, string $lpaUid): ?array
*/
private function preSaveOfRequestFeature(string $userId, string $lpaUid): ?array
{
$lpasAdded = $this->lpaService->getAllForUser($userId);
$lpasAdded = $this->lpaService->getAllLpasAndRequestsForUser($userId);

foreach ($lpasAdded as $userLpaActorToken => $lpaData) {
if ($lpaData['lpa']['uId'] === $lpaUid) {
Expand Down
Loading