chore: minor update for team header-auth properties

This commit is contained in:
nivedin
2023-12-20 22:22:05 +05:30
committed by Andrew Bastin
parent 6d7b0e11a3
commit a4aa808103
2 changed files with 10 additions and 2 deletions

View File

@@ -1034,6 +1034,11 @@ export default class NewTeamCollectionAdapter {
}
}
/**
* Used to obtain the inherited auth and headers for a given folder path, used for both REST and GraphQL team collections
* @param folderPath the path of the folder to cascade the auth from
* @returns the inherited auth and headers for the given folder path
*/
public cascadeParentCollectionForHeaderAuth(folderPath: string) {
let auth: HoppInheritedProperty["auth"] = {
parentID: folderPath ?? "",
@@ -1089,7 +1094,10 @@ export default class NewTeamCollectionAdapter {
const parentFolderAuth = data.auth
const parentFolderHeaders = data.headers
if (parentFolderAuth?.authType === "inherit" && path.length === 1) {
if (
parentFolderAuth?.authType === "inherit" &&
[...path.slice(0, i + 1)].length === 1
) {
auth = {
parentID: [...path.slice(0, i + 1)].join("/"),
parentName: parentFolder.title,

View File

@@ -68,7 +68,7 @@ export function navigateToFolderWithIndexPath(
}
/**
* Used to obtain the inherited auth and headers for a given folder path, used for both REST and GraphQL
* Used to obtain the inherited auth and headers for a given folder path, used for both REST and GraphQL personal collections
* @param folderPath the path of the folder to cascade the auth from
* @param type the type of collection
* @returns the inherited auth and headers for the given folder path