Skip to content

Commit 981e987

Browse files
committed
fix(team-manager): team is already teamid
Signed-off-by: Maxence Lange <[email protected]>
1 parent 1829269 commit 981e987

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/Controller/TeamsApiController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function resolveOne(string $teamId): DataResponse {
6666
public function listTeams(string $providerId, string $resourceId): DataResponse {
6767
/** @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */
6868
$teams = $this->teamManager->getTeamsForResource($providerId, $resourceId, $this->userId);
69-
$sharesPerTeams = $this->teamManager->getSharedWithList(array_map(fn (Team $team): string => $team->getId(), $teams), $this->userId);
70-
$listTeams = array_values(array_map(function (Team $team) use ($sharesPerTeams) {
69+
$sharesPerTeams = $this->teamManager->getSharedWithList(array_map(static fn (Team $team): string => $team->getId(), $teams), $this->userId);
70+
$listTeams = array_values(array_map(static function (Team $team) use ($sharesPerTeams) {
7171
$response = $team->jsonSerialize();
7272
$response['resources'] = array_map(static fn (TeamResource $resource) => $resource->jsonSerialize(), $sharesPerTeams[$team->getId()] ?? []);
7373
return $response;

lib/private/Teams/TeamManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getSharedWithList(array $teams, string $userId): array {
9595
$resources[] = $provider->getSharedWithList($teams, $userId);
9696
} else {
9797
foreach ($teams as $team) {
98-
$resources[] = [$team->getId() => $provider->getSharedWith($team->getId())];
98+
$resources[] = [$team => $provider->getSharedWith($team)];
9999
}
100100
}
101101
}

lib/public/Teams/ITeamManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getSharedWith(string $teamId, string $userId): array;
4242
public function getTeamsForResource(string $providerId, string $resourceId, string $userId): array;
4343

4444
/**
45-
* @param list<Team> $teams
45+
* @param string[] $teams
4646
* @return array<string, list<TeamResource>>
4747
*
4848
* @since 33.0.0

0 commit comments

Comments
 (0)