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