Skip to content

Commit

Permalink
missing added_groups in JSON and JS
Browse files Browse the repository at this point in the history
  • Loading branch information
smarinier committed Jun 14, 2024
1 parent 1e47921 commit 2685994
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/Controller/WorkspaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,20 @@ public function findAll(): JSONResponse {
$workspaces = $this->workspaceService->getAll();
$spaces = [];
foreach ($workspaces as $workspace) {
$space = array_merge(
$this->folderHelper->getFolder(
$workspace['groupfolder_id'],
$this->rootFolder->getRootFolderStorageId()
),
$workspace
$folderInfo = $this->folderHelper->getFolder(
$workspace['groupfolder_id'],
$this->rootFolder->getRootFolderStorageId()
);
$space = ($folderInfo !== false) ? array_merge(
$folderInfo,
$workspace
): $workspace;

$gids = array_keys($space['groups']);
$gids = array_keys($space['groups'] ?? []);
$groups = array_map(fn ($gid) => $this->groupManager->get($gid), $gids);

$addedGroups = [];
foreach(array_keys($workspace['groups']) as $gid) {
foreach($gids as $gid) {
$addedToGroup = $this->connectedGroups->getConnectedGroupsToSpaceGroup($gid);
if ($addedToGroup !== null) {
$addedGroups = array_merge($addedGroups, $addedToGroup);
Expand Down
1 change: 1 addition & 0 deletions src/WorkspaceContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default {
color: space.color_code,
groupfolderId: space.groupfolder_id,
groups: space.groups,
added_groups: space.added_groups ?? [],
id: space.id,
isOpen: false,
name: space.name,
Expand Down

0 comments on commit 2685994

Please sign in to comment.