UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

48 lines (47 loc) 2.47 kB
/** * CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52 * Update:: import { IJSFetchReturn } to '@mikezimm/fps-core-v7/lib/components/molecules/SpHttp/doSpJsFetch;' */ // import { findSimilarNavNodes, findSpecificNavNodes } from '../functions/findNavNodes'; // import { fetchMyHubNav } from '../HubSiteData/fetchMyHubNav'; import { fetchMyHubsites } from './fetchMyHubsites'; import { fetchMySubsites } from './fetchMySubsites'; import { check4This, Check4 } from '../../../../logic/Links/CheckSearch'; /** * fetchMyHubSubs will syncronsly fetch the links for the current site's parent hub's associated sites and the current site's subsites. * Used in Pivot Tiles and Hub Connections. * * @param webUrl * @param departmentId * @returns */ export async function fetchMyHubSubs(fpsSpService, webUrl, depth, departmentId) { // const [ hubs, subs, nav ] = await Promise.all([ const [hubs, subs,] = await Promise.all([ fetchMyHubsites(fpsSpService, webUrl, depth, departmentId, 'HubAndAssoc'), fetchMySubsites(fpsSpService, webUrl), // fetchMyHubNav( webUrl, departmentId ), ]); // Verified on /sites/TheSharePointHub // findSimilarNavNodes( nav, 'Title', 'Branding' ); // findSimilarNavNodes( nav, 'Title', 'Branding', 2 ); // findSimilarNavNodes( nav, 'Title', 'Branding', 1 ); // findSimilarNavNodes( nav, 'Title', 'Child', 1 ); // findSimilarNavNodes( nav, 'Title', 'TestHeader', ); // findSpecificNavNodes( nav, 'Title', [ 'SharePoint Online Info (Public)', 'Branding' ] ); // findSpecificNavNodes( nav, 'Title', [ 'SharePoint Team (Access required)', 'TestHeader' ] ); // findSpecificNavNodes( nav, 'Title', [ 'Hubs (DO NOT request access)', 'Child', ] ); // findSpecificNavNodes( nav, 'Title', [ 'Hubs (DO NOT request access)', 'TheSharePointHub' ] ); // findSpecificNavNodes( nav, 'Title', [ 'Hubs (DO NOT request access)','Child', 'TheSharePointHub' ] ); // findSpecificNavNodes( nav, 'Title', [ 'SharePoint Online Info (Public)' ] ); // findSpecificNavNodes( nav, 'Title', [ 'The Share PointHub' ] ); const results = { hubs: hubs, subs: subs, // nav: nav, }; if (check4This(Check4.fpsShowFetchResults_Eq_true) === true) console.log(`fps-library-v2 Complete: fetchMyHubSubs ~ 51 results`, results); return results; } //# sourceMappingURL=fetchMyHubsSubs.js.map