import{bc as e,e2 as o,a7 as s}from"./app-BgLa5dit.js";const g={searchOrganisation(a,t){let n=`/ajax/system/organisations/search?query=${a}`;return t&&(n+=`&filter={page:${t}}`),{url:n,key:`organisation:search:${a}${t?`:${t}`:""}`}},getOrganisation(a){return{url:`/ajax/system/organisations/${a}`,key:`organisation:get:${a}`}},getCustomersFromOrganisation(a,t="1"){return{url:s.urlBuilder(`/ajax/system/organisations/${a}/customers-cft`,{cursor:t}),key:`organisation:customers:${a}:${t}`,formatData:o.convertLegacyPaginatedCollection}},getAllCustomersFromOrganisation(a){return{url:`/ajax/organisations/${a}/customers`,key:`organisation:customers:${a}:all`}},updateOrganisation(a,t){const n=`organisation:get:${a}`;return{url:`/ajax/system/organisations/${a}`,key:`update:organisation:${a}`,invalidationKeys:[n],updateState:{keys:[n],updateData:i=>({[n]:{...i[n],...t}})},type:e.PUT,data:t}},removeFromOrganisation(a,t){return{url:`/ajax/curator/objects/${a}/dissociate`,key:`remove:organisation:${a}:${t}`,data:[t],invalidationKeys:[`organisation:get:${a}`,`organisation:customers:${a}`,`customers:${t}`],type:e.POST}},addToOrganisation(a,t){return{url:`/ajax/curator/objects/${a}/associate`,key:`add:organisation:${a}:${t.join(",")}`,data:t,invalidationKeys:[`organisation:customers:${a}`,`customers:${t.join(",")}`],type:e.POST}},getAuthenticationMethods(a){return{url:`/ajax/organisations/${a}/authentication-methods`,key:`organisation:authentication-methods:${a}`,formatData:t=>t.external}},getOrganisationDomains(a){return{url:`/ajax/organisations/${a}/domains`,key:`domains:organisation:${a}`}},createOrganisationDomains(a,t){return{url:`/ajax/organisations/${a}/domains`,data:t.map(n=>({name:n})),type:e.POST,key:`domains:organisation:${a}:save`,invalidationKeys:[`domains:organisation:${a}`,"domains:customer:*"]}},deleteOrganisationDomain(a,t){return{url:`/ajax/account-domains/${a}`,type:e.DELETE,key:`domains:organisation:${t}:delete:${a}`,invalidationKeys:[`domains:organisation:${t}`,"domains:customer:*"]}}};export{g as O};
//# sourceMappingURL=DNClpFKN.chunk.js.map
