Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing added_groups in JSON and JS #1021

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'] ?? []);
zak39 marked this conversation as resolved.
Show resolved Hide resolved
$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 ?? [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, it's not necessary, as you will always return an empty array, no? 🤔

id: space.id,
isOpen: false,
name: space.name,
Expand Down
Loading