Skip to content

Commit 1f9a862

Browse files
authored
Merge pull request #1064 from ministryofjustice/UML-1697-filter-not-activated-lpa-from-dashboard-2.0
Filter not activated LPAs 2.0
2 parents 148cda8 + 094916f commit 1f9a862

File tree

5 files changed

+299
-46
lines changed

5 files changed

+299
-46
lines changed

.idea/php.xml

+167-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service-api/app/src/App/src/Service/Lpa/LpaAlreadyAdded.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ public function __construct(
4646
public function __invoke(string $userId, string $lpaUid): ?array
4747
{
4848
if (($this->featureEnabled)('save_older_lpa_requests')) {
49-
5049
$savedLpaRecords = $this->userLpaActorMapRepository->getUsersLpas($userId);
5150

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

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

8281
return null;
83-
8482
} else {
8583
return $this->preSaveOfRequestFeature($userId, $lpaUid);
8684
}
@@ -95,7 +93,7 @@ public function __invoke(string $userId, string $lpaUid): ?array
9593
*/
9694
private function preSaveOfRequestFeature(string $userId, string $lpaUid): ?array
9795
{
98-
$lpasAdded = $this->lpaService->getAllForUser($userId);
96+
$lpasAdded = $this->lpaService->getAllLpasAndRequestsForUser($userId);
9997

10098
foreach ($lpasAdded as $userLpaActorToken => $lpaData) {
10199
if ($lpaData['lpa']['uId'] === $lpaUid) {

0 commit comments

Comments
 (0)