linkSiteAndPage

Function

Link a Page and a Site, or vice-versa This is a super tolerant function. It can be passed id's, models or a mix. It will handle either the site or the page items being missing It will handle cases where the current user lacks update privs to either item or rights to change the sharing. Of course in those cases we clearly can't make the changes, and this function will resolve as though they were made, usually the UI tier will have ensured that the current user has write access to at least one of the main entities

  • linkSiteAndPage(linkRequestOptions: {
    authentication:
    UserSession
    pageId:
    string
    pageModel:
    IModel
    pageSlug:
    string
    siteId:
    string
    siteModel:
    IModel
    }) : Promise<{
    pageModel:
    IModel
    siteModel:
    IModel
    }>

Parameters

Parameter Type Default Notes
linkRequestOptions Required {
authentication:
UserSession
pageId:
string
pageModel:
IModel
pageSlug:
string
siteId:
string
siteModel:
IModel
}

Returns

Promise<{
pageModel:
IModel
siteModel:
IModel
}>

Function defined in packages/sites/src/link-site-and-page.ts:29