diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts index 93467564b..728efd7e9 100755 --- a/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts +++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/favorites/favorites-api.ts @@ -37,9 +37,9 @@ export class FavoritesApi extends RepoApi { super(username, password); } - async addFavorite(api: RepoClient, nodeType: string, name: string) { + async addFavorite(api: RepoClient, nodeType: string, name: string, parentFolderId?: string) { try { - const nodeId = (await api.nodes.getNodeByPath(name)).entry.id; + const nodeId = (await api.nodes.getNodeByPath(name, parentFolderId)).entry.id; const data = { target: { [nodeType]: { diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts index f9b57f15b..f1c912976 100755 --- a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts +++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts @@ -36,10 +36,10 @@ export class NodesApi extends RepoApi { super(username, password); } - async getNodeByPath(relativePath: string = '/'): Promise { + async getNodeByPath(relativePath: string = '/', parentFolderId: string = '-my-'): Promise { try { await this.apiAuth(); - return await this.nodesApi.getNode('-my-', { relativePath }); + return await this.nodesApi.getNode(parentFolderId, { relativePath }); } catch (error) { this.handleError(`${this.constructor.name} ${this.getNodeByPath.name}`, error); return null; @@ -155,9 +155,9 @@ export class NodesApi extends RepoApi { } } - async deleteNodeByPath(path: string, permanent: boolean = true): Promise { + async deleteNodeByPath(path: string, permanent: boolean = true, parentFolderId?: string): Promise { try { - const id = (await this.getNodeByPath(path)).entry.id; + const id = (await this.getNodeByPath(path, parentFolderId)).entry.id; await this.deleteNodeById(id, permanent); } catch (error) { this.handleError(`${this.constructor.name} ${this.deleteNodeByPath.name}`, error);