mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(team-manager): team is already teamid
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
1829269f9d
commit
981e987bd0
3 changed files with 4 additions and 4 deletions
|
|
@ -66,8 +66,8 @@ class TeamsApiController extends OCSController {
|
|||
public function listTeams(string $providerId, string $resourceId): DataResponse {
|
||||
/** @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */
|
||||
$teams = $this->teamManager->getTeamsForResource($providerId, $resourceId, $this->userId);
|
||||
$sharesPerTeams = $this->teamManager->getSharedWithList(array_map(fn (Team $team): string => $team->getId(), $teams), $this->userId);
|
||||
$listTeams = array_values(array_map(function (Team $team) use ($sharesPerTeams) {
|
||||
$sharesPerTeams = $this->teamManager->getSharedWithList(array_map(static fn (Team $team): string => $team->getId(), $teams), $this->userId);
|
||||
$listTeams = array_values(array_map(static function (Team $team) use ($sharesPerTeams) {
|
||||
$response = $team->jsonSerialize();
|
||||
$response['resources'] = array_map(static fn (TeamResource $resource) => $resource->jsonSerialize(), $sharesPerTeams[$team->getId()] ?? []);
|
||||
return $response;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class TeamManager implements ITeamManager {
|
|||
$resources[] = $provider->getSharedWithList($teams, $userId);
|
||||
} else {
|
||||
foreach ($teams as $team) {
|
||||
$resources[] = [$team->getId() => $provider->getSharedWith($team->getId())];
|
||||
$resources[] = [$team => $provider->getSharedWith($team)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ interface ITeamManager {
|
|||
public function getTeamsForResource(string $providerId, string $resourceId, string $userId): array;
|
||||
|
||||
/**
|
||||
* @param list<Team> $teams
|
||||
* @param string[] $teams
|
||||
* @return array<string, list<TeamResource>>
|
||||
*
|
||||
* @since 33.0.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue