X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9c2a0a5c92ca0e7e2a09a0f74705f94939d3e081..d19d853e83383a6b75f638be99472aa626a05524:/src/services/groups-service/groups-service.ts?ds=sidebyside diff --git a/src/services/groups-service/groups-service.ts b/src/services/groups-service/groups-service.ts index c4c56f38fc..d8b33f601f 100644 --- a/src/services/groups-service/groups-service.ts +++ b/src/services/groups-service/groups-service.ts @@ -3,7 +3,8 @@ // SPDX-License-Identifier: AGPL-3.0 import * as _ from "lodash"; -import { CommonResourceService, ListResults, ListArguments } from '~/services/common-service/common-resource-service'; +import { CommonResourceService } from '~/services/common-service/common-resource-service'; +import { ListResults, ListArguments } from '~/services/common-service/common-service'; import { AxiosInstance } from "axios"; import { CollectionResource } from "~/models/collection"; import { ProjectResource } from "~/models/project"; @@ -20,6 +21,7 @@ export interface ContentsArguments { filters?: string; recursive?: boolean; includeTrash?: boolean; + excludeHomeProject?: boolean; } export interface SharedArguments extends ListArguments { @@ -45,18 +47,20 @@ export class GroupsService extends Tras order: order ? order : undefined }; + const pathUrl = uuid ? `${uuid}/contents` : 'contents'; const response = await CommonResourceService.defaultResponse( - this.serverApi - .get(this.resourceType + `${uuid}/contents`, { - params: CommonResourceService.mapKeys(_.snakeCase)(params) - }), - this.actions, - false - ); + this.serverApi + .get(this.resourceType + pathUrl, { + params: CommonResourceService.mapKeys(_.snakeCase)(params) + }), + this.actions, + false + ); + const { items, ...res } = response; const mappedItems = items.map((item: GroupContentsResource) => { const mappedItem = TrashableResourceService.mapKeys(_.camelCase)(item); - if (item.kind === ResourceKind.COLLECTION) { + if (item.kind === ResourceKind.COLLECTION || item.kind === ResourceKind.PROJECT) { const { properties } = item; return { ...mappedItem, properties }; } else {