Liferay.Loader.define("commerce-organization-web@5.0.46/js/data/accounts",["module","exports","require","../utils/constants","../utils/fetch"],(function(t,e,n){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.getAccounts=function getAccounts(t,e=[]){const n=new URL("".concat(themeDisplay.getPathContext()).concat(o),themeDisplay.getPortalURL());t&&n.searchParams.append("search",t);e.length&&n.searchParams.append("filter","".concat(e.map((t=>"(organizationIds eq '".concat(t,"')"))).join(" or ")));return(0,a.fetchFromHeadless)(n)},e.deleteAccount=function deleteAccount(t){return(0,a.fetchFromHeadless)("".concat(o,"/").concat(t),{method:"DELETE"},null,!0)},e.changeOrganizationParent=function changeOrganizationParent(e,n,c){return(0,a.fetchFromHeadless)("".concat(t,"/").concat(n,"/").concat(c),{body:JSON.stringify([e]),method:"PATCH"})},e.getAccount=function getAccount(t){const e=new URL("".concat(themeDisplay.getPathContext()).concat(o,"/").concat(t),themeDisplay.getPortalURL());return e.searchParams.append("nestedFields",c.USERS_PROPERTY_NAME_IN_ACCOUNT),(0,a.fetchFromHeadless)(e)},e.updateAccount=function updateAccount(t,e){return(0,a.fetchFromHeadless)("".concat(o,"/").concat(t),{body:JSON.stringify(e),method:"PATCH"})},e.createAccount=function createAccount(t,e){return(0,a.fetchFromHeadless)(o,{body:JSON.stringify({name:t,organizationIds:e}),method:"POST"})};var c=n("../utils/constants"),a=n("../utils/fetch");const t="/o/headless-admin-user/v1.0/organizations/move-accounts",o="/o/headless-admin-user/v1.0/accounts"}}));
//# sourceMappingURL=accounts.js.map