mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(team-manager): team is already teamid
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
879cf62fa5
commit
ae250d08f0
3 changed files with 4 additions and 4 deletions
|
|
@ -65,8 +65,8 @@ class TeamsApiController extends \OCP\AppFramework\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();
|
||||
/** @psalm-suppress PossiblyNullArgument The route is limited to logged in users */
|
||||
$response['resources'] = array_map(static fn (TeamResource $resource) => $resource->jsonSerialize(), $sharesPerTeams[$team->getId()] ?? []);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,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)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,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 31.0.11
|
||||
|
|
|
|||
Loading…
Reference in a new issue