Skip to content

Commit ae250d0

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
fix(team-manager): team is already teamid
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 879cf62 commit ae250d0

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
@@ -65,8 +65,8 @@ public function resolveOne(string $teamId): DataResponse {
6565
public function listTeams(string $providerId, string $resourceId): DataResponse {
6666
/** @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */
6767
$teams = $this->teamManager->getTeamsForResource($providerId, $resourceId, $this->userId);
68-
$sharesPerTeams = $this->teamManager->getSharedWithList(array_map(fn (Team $team): string => $team->getId(), $teams), $this->userId);
69-
$listTeams = array_values(array_map(function (Team $team) use ($sharesPerTeams) {
68+
$sharesPerTeams = $this->teamManager->getSharedWithList(array_map(static fn (Team $team): string => $team->getId(), $teams), $this->userId);
69+
$listTeams = array_values(array_map(static function (Team $team) use ($sharesPerTeams) {
7070
$response = $team->jsonSerialize();
7171
/** @psalm-suppress PossiblyNullArgument The route is limited to logged in users */
7272
$response['resources'] = array_map(static fn (TeamResource $resource) => $resource->jsonSerialize(), $sharesPerTeams[$team->getId()] ?? []);

lib/private/Teams/TeamManager.php

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

lib/public/Teams/ITeamManager.php

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

4343
/**
44-
* @param list<Team> $teams
44+
* @param string[] $teams
4545
* @return array<string, list<TeamResource>>
4646
*
4747
* @since 31.0.11

0 commit comments

Comments
 (0)