umwd-components 0.1.719 → 0.1.721
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/components/common/EnhancedTable/EnhancedTable.js +1 -1
- package/dist/cjs/src/components/common/EnhancedTable/EnhancedTableRow.js +1 -1
- package/dist/cjs/src/components/page-elements/FeaturesSection.js +1 -1
- package/dist/cjs/src/data/loaders/e-commerce/getAllOpos.js +1 -1
- package/dist/cjs/src/data/loaders/e-commerce/iros/getAllIros.js +1 -1
- package/dist/cjs/src/data/loaders/loaders.js +1 -1
- package/dist/cjs/src/data/loaders/page-elements/getSinglePage.js +1 -1
- package/dist/cjs/src/data/services/get-user-me-loader.js +1 -1
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/src/components/common/EnhancedTable/EnhancedTable.js +3 -3
- package/dist/esm/src/components/common/EnhancedTable/EnhancedTableRow.js +1 -1
- package/dist/esm/src/components/page-elements/FeaturesSection.js +24 -23
- package/dist/esm/src/data/loaders/e-commerce/getAllOpos.js +1 -1
- package/dist/esm/src/data/loaders/e-commerce/iros/getAllIros.js +2 -2
- package/dist/esm/src/data/loaders/loaders.js +59 -53
- package/dist/esm/src/data/loaders/page-elements/getSinglePage.js +50 -49
- package/dist/esm/src/data/services/get-user-me-loader.js +47 -38
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/types/data/loaders/e-commerce/iros/getAllIros.d.ts +1 -1
- package/dist/esm/types/types/common/enhancedTable/types.d.ts +4 -4
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("@mui/material/Box"),r=require("@mui/material/Table"),i=require("@mui/material/TableBody"),l=require("@mui/material/TableCell"),s=require("@mui/material/TableContainer"),n=require("@mui/material/TablePagination"),o=require("@mui/material/TableRow"),c=require("@mui/material/Paper"),u=require("@mui/material/FormControlLabel"),d=require("@mui/material/Switch"),h=require("./EnhancedTableHead.js"),m=require("./EnhancedTableToolbar.js"),g=require("./EnhancedTableRow.js"),w=require("./EnhancedTableFilterRow.js"),S=require("next/navigation");exports.default=function(b){const{data:x,meta:f,headCells:j,subHeadCells:p,withSelection:q,title:C,subTitle:P,functions:T,selectFunctions:R}=b,{replace:y}=S.useRouter(),F=S.usePathname(),E=S.useSearchParams(),[v,k]=t.useState("asc"),[B,$]=t.useState("
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("@mui/material/Box"),r=require("@mui/material/Table"),i=require("@mui/material/TableBody"),l=require("@mui/material/TableCell"),s=require("@mui/material/TableContainer"),n=require("@mui/material/TablePagination"),o=require("@mui/material/TableRow"),c=require("@mui/material/Paper"),u=require("@mui/material/FormControlLabel"),d=require("@mui/material/Switch"),h=require("./EnhancedTableHead.js"),m=require("./EnhancedTableToolbar.js"),g=require("./EnhancedTableRow.js"),w=require("./EnhancedTableFilterRow.js"),S=require("next/navigation");exports.default=function(b){const{data:x,meta:f,headCells:j,subHeadCells:p,withSelection:q,title:C,subTitle:P,functions:T,selectFunctions:R}=b,{replace:y}=S.useRouter(),F=S.usePathname(),E=S.useSearchParams(),[v,k]=t.useState("asc"),[B,$]=t.useState("createdAt"),[O,A]=t.useState([]),[H,I]=t.useState(0),[L,U]=t.useState(!1),[_,z]=t.useState(5),[D,M]=t.useState(!1),[W,X]=t.useState(()=>{const e=new URLSearchParams(E?.toString()),t={};return j.forEach(a=>{if(a.filterable){const r=e.get(`filter[${a.id}]`);r&&(t[a.id]=r)}}),t}),Y=j.some(e=>e.filterable),G=(e,t)=>{const a=O.indexOf(t);let r=[];-1===a?r=r.concat(O,t):0===a?r=r.concat(O.slice(1)):a===O.length-1?r=r.concat(O.slice(0,-1)):a>0&&(r=r.concat(O.slice(0,a),O.slice(a+1))),A(r)},J=H+1===f?.pagination?.pageCount?f?.pagination?.total-f?.pagination?.pageCount*_:0;return t.useEffect(()=>{if(E){const e={x:window.scrollX,y:window.scrollY},t=new URLSearchParams(E);v?t.set("order",v):t.delete("order"),B?t.set("orderBy",B):t.delete("orderBy"),H?t.set("page",H.toString()):t.delete("page"),_?t.set("rowsPerPage",_.toString()):t.delete("rowsPerPage"),Object.entries(W).forEach(([e,a])=>{a?t.set(`filter[${e}]`,a):t.delete(`filter[${e}]`)}),y(`${F}?${t.toString()}`,{scroll:!1}),requestAnimationFrame(()=>{window.scrollTo(e.x,e.y)})}},[v,B,H,_,W]),e.jsxs(a,{sx:{width:"100%"},children:[e.jsxs(c,{sx:{width:"100%",mb:2},children:[e.jsx(m.default,{selected:O,setSelected:A,title:C,functions:T,selectFunctions:R,showFilters:D,onToggleFilters:()=>M(!D),hasFilterableColumns:Y}),e.jsx(s,{children:e.jsxs(r,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:L?"small":"medium",children:[e.jsx(h.default,{numSelected:O.length,order:v,orderBy:B,onSelectAllClick:e=>{if(e.target.checked){const e=x.map(e=>e.documentId);return void A(e)}A([])},onRequestSort:(e,t)=>{k(B===t&&"asc"===v?"desc":"asc"),$(t)},rowCount:x.length,headCells:j,withSelection:q,withSubRows:!!p}),e.jsxs(i,{children:[D&&e.jsx(w.default,{headCells:j,filters:W,onFilterChange:(e,t)=>{X(a=>({...a,[e]:t})),I(0)},withSelection:q,withSubRows:!!p}),x.map((t,a)=>e.jsx(g.default,{row:t,headCells:j,subHeadCells:p,withSelection:q,isSelected:O.includes(t.documentId),handleSelectClick:G,subTitle:P},t.id)),J>0&&e.jsx(o,{style:{height:(L?33:53)*J},children:e.jsx(l,{colSpan:j.length+(q?1:0)+(p?1:0)})})]})]})}),e.jsx(n,{rowsPerPageOptions:[5,10,25],component:"div",count:f?.pagination?.total,rowsPerPage:_,page:H,onPageChange:(e,t)=>{I(t)},onRowsPerPageChange:e=>{z(parseInt(e.target.value,10)),I(0)}})]}),e.jsx(u,{control:e.jsx(d,{checked:L,onChange:e=>{U(e.target.checked)}}),label:"Dense padding"})]})};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),r=require("@mui/material/Box"),a=require("@mui/material/TableRow"),l=require("@mui/material/TableCell"),n=require("@mui/material/IconButton"),d=require("@mui/material/Collapse"),t=require("@mui/material/Typography"),s=require("@mui/material/Table"),o=require("@mui/material/TableHead"),u=require("@mui/material/TableBody"),c=require("@mui/material/Checkbox"),m=require("@mui/icons-material/KeyboardArrowUp"),h=require("@mui/icons-material/KeyboardArrowDown");exports.default=function(x,b){const{row:p,headCells:j,subHeadCells:g,withSelection:q,isSelected:y,handleSelectClick:k,subTitle:w}=x,{subRows:C}=p,[T,$]=i.useState(!1),f=`enhanced-table-checkbox-${b}`,B=j.length+(q?1:0)+(g?1:0);return e.jsxs(i.Fragment,{children:[e.jsxs(a,{sx:{"& > *":{borderBottom:"unset"}},children:[q&&e.jsx(l,{padding:"checkbox",children:e.jsx(c,{color:"primary",checked:y,inputProps:{"aria-labelledby":f},onClick:e=>k&&k(e,p.
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),r=require("@mui/material/Box"),a=require("@mui/material/TableRow"),l=require("@mui/material/TableCell"),n=require("@mui/material/IconButton"),d=require("@mui/material/Collapse"),t=require("@mui/material/Typography"),s=require("@mui/material/Table"),o=require("@mui/material/TableHead"),u=require("@mui/material/TableBody"),c=require("@mui/material/Checkbox"),m=require("@mui/icons-material/KeyboardArrowUp"),h=require("@mui/icons-material/KeyboardArrowDown");exports.default=function(x,b){const{row:p,headCells:j,subHeadCells:g,withSelection:q,isSelected:y,handleSelectClick:k,subTitle:w}=x,{subRows:C}=p,[T,$]=i.useState(!1),f=`enhanced-table-checkbox-${b}`,B=j.length+(q?1:0)+(g?1:0);return e.jsxs(i.Fragment,{children:[e.jsxs(a,{sx:{"& > *":{borderBottom:"unset"}},children:[q&&e.jsx(l,{padding:"checkbox",children:e.jsx(c,{color:"primary",checked:y,inputProps:{"aria-labelledby":f},onClick:e=>k&&k(e,p.documentId)})}),C&&g&&e.jsx(l,{children:e.jsx(n,{"aria-label":"expand row",size:"small",onClick:()=>$(!T),children:T?e.jsx(m,{}):e.jsx(h,{})})}),j.map(i=>e.jsx(l,{align:i.numeric?"right":"left",padding:i.disablePadding?"none":"normal",children:p[i.id]},i.id))]}),C&&g&&e.jsx(a,{children:e.jsx(l,{style:{paddingBottom:0,paddingTop:0},colSpan:B,children:e.jsx(d,{in:T,timeout:"auto",unmountOnExit:!0,children:e.jsxs(r,{sx:{margin:1},children:[e.jsx(t,{variant:"h6",gutterBottom:!0,component:"div",children:w}),e.jsxs(s,{size:"small","aria-label":"purchases",children:[e.jsx(o,{children:e.jsx(a,{children:g.map(i=>e.jsx(l,{align:i.numeric?"right":"left",padding:i.disablePadding?"none":"normal",children:i.label},`${i.id}${i.label}`))})}),e.jsx(u,{children:C.map((i,r)=>e.jsx(a,{children:g.map((r,a)=>e.jsx(l,{align:r.numeric?"right":"left",padding:r.disablePadding?"none":"normal",children:i[r.id]},`${a}${r.label}`))},`${i.key}${r}`))})]})]})})})})]})};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("@mui/material/Stack"),t=require("@mui/material/Card"),n=require("@mui/material/CardContent"),a=require("@mui/material/Typography"),s=require("@mui/material/Container"),l=require("@mui/material/Box"),o=require("../../lib/getIcon.js"),u=require("@mui/material/styles");const c=i.lazy(()=>import("mui-markdown"));exports.FeatureSection=function({data:i}){const{feature:m,maxWidth:x,sx:d=[],anchor:h=""}=i,p=u.useTheme();return e.jsx(s,{maxWidth:x||"lg",sx:{my:1,...d},id:h,children:e.jsx(r,{spacing:2,direction:"row",justifyContent:"stretch",flexWrap:"wrap",sx:{width:"100%",[p.breakpoints.up("xs")]:{flexDirection:"column"},[p.breakpoints.up("sm")]:{flexDirection:"row"}},useFlexGap:!0,children:m.map(i=>{const r=o.default(i.icon);return e.jsx(t,{id:i.anchor||"",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,minWidth:275},children:e.jsxs(n,{children:[e.jsx(l,{sx:{height:100,display:"grid",alignItems:"center",justifyContent:"center"},children:null!==r&&e.jsx(r,{sx:{mr:2,mt:.2,width:"75px",height:"75px",fill:"none",stroke:"currentColor",strokeWidth:.5}})}),e.jsx(a,{variant:"h5",align:"center",component:"div",sx:{mb:2,height:"4rem"},children:i.heading}),e.jsx(a,{variant:"h6",align:"center",component:"div",sx:{mb:2,height:"4rem"},children:i.subHeading}),i.text&&e.jsx(c,{children:i.text})]})},i.id)})})})};
|
|
7
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("@mui/material/Stack"),t=require("@mui/material/Card"),n=require("@mui/material/CardContent"),a=require("@mui/material/Typography"),s=require("@mui/material/Container"),l=require("@mui/material/Box"),o=require("../../lib/getIcon.js"),u=require("@mui/material/styles");const c=i.lazy(()=>import("mui-markdown"));exports.FeatureSection=function({data:i}){const{feature:m,maxWidth:x,sx:d=[],anchor:h=""}=i,p=u.useTheme();return e.jsx(s,{maxWidth:x||"lg",sx:{my:1,...d},id:h,children:e.jsx(r,{spacing:2,direction:"row",justifyContent:"stretch",flexWrap:"wrap",sx:{width:"100%",[p.breakpoints.up("xs")]:{flexDirection:"column"},[p.breakpoints.up("sm")]:{flexDirection:"row"}},useFlexGap:!0,children:m&&m.map(i=>{const r=o.default(i.icon);return e.jsx(t,{id:i.anchor||"",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,minWidth:275},children:e.jsxs(n,{children:[e.jsx(l,{sx:{height:100,display:"grid",alignItems:"center",justifyContent:"center"},children:null!==r&&e.jsx(r,{sx:{mr:2,mt:.2,width:"75px",height:"75px",fill:"none",stroke:"currentColor",strokeWidth:.5}})}),e.jsx(a,{variant:"h5",align:"center",component:"div",sx:{mb:2,height:"4rem"},children:i.heading}),e.jsx(a,{variant:"h6",align:"center",component:"div",sx:{mb:2,height:"4rem"},children:i.subHeading}),i.text&&e.jsx(c,{children:i.text})]})},i.id)})})})};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var e=require("../../../../node_modules/qs/lib/index.js"),s=require("../loaders.js"),r=require("../../../lib/utils.js"),i=require("next/cache"),t=require("../../services/get-user-me-loader.js"),a=require("../../../lib/processFilters.js");const l=r.getStrapiURL();exports.getAllOpos=async function(r,d,o,u,n=[!1],p={}){i.unstable_noStore();const c=await t.getUserRole(),_=c?.data?.role?.type,b="enduser"===_,y=new URL("/api/opos",l),m=a.processFilters(p);return y.search=e.default.stringify({filters:{is_archive:{$in:n},...m},sort:`${u||"
|
|
7
|
+
"use strict";var e=require("../../../../node_modules/qs/lib/index.js"),s=require("../loaders.js"),r=require("../../../lib/utils.js"),i=require("next/cache"),t=require("../../services/get-user-me-loader.js"),a=require("../../../lib/processFilters.js");const l=r.getStrapiURL();exports.getAllOpos=async function(r,d,o,u,n=[!1],p={}){i.unstable_noStore();const c=await t.getUserRole(),_=c?.data?.role?.type,b="enduser"===_,y=new URL("/api/opos",l),m=a.processFilters(p);return y.search=e.default.stringify({filters:{is_archive:{$in:n},...m},sort:`${u||"createdAt"}:${o||"desc"}`,populate:{opo_items:{populate:{product:{populate:{price:!0}},reports:!0}},customer:!!b&&{populate:{company_address:!0,delivery_address:!0,billing_address:!0,business_credentials:!0}},payments:!0,invoice:{populate:{seller_business_credentials:!0,seller_company_address:!0,buyer_company_address:!0,buyer_delivery_address:!0,buyer_billing_address:!0,buyer_business_credentials:!0,items:!0,admin_items:!0}},iros:{fields:["id","uuid","status"]}},pagination:{pageSize:d||10,page:r?r+1:1}}),await s.fetchData(y.href)};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var e=require("../../../../../node_modules/qs/lib/index.js"),s=require("../../loaders.js"),r=require("../../../../lib/utils.js"),i=require("next/cache"),t=require("../../../services/get-user-me-loader.js"),a=require("../../../../lib/processFilters.js");const l=r.getStrapiURL();exports.getAllIros=async function(r,d,o,n,u=[!1],
|
|
7
|
+
"use strict";var e=require("../../../../../node_modules/qs/lib/index.js"),s=require("../../loaders.js"),r=require("../../../../lib/utils.js"),i=require("next/cache"),t=require("../../../services/get-user-me-loader.js"),a=require("../../../../lib/processFilters.js");const l=r.getStrapiURL();exports.getAllIros=async function(r,d,o,n="createdAt",u=[!1],c={}){i.unstable_noStore();const p=await t.getUserRole(),_=p?.data?.role?.type,b="enduser"===_,y=new URL("/api/iros",l),g=a.processFilters(c);return y.search=e.default.stringify({filters:{is_archive:{$in:u},...g},sort:`${n||"createdAt"}:${o||"desc"}`,populate:{iro_items:{populate:{product:{populate:{price:!0}},reports:!0}},customer:!!b&&{populate:{company_address:!0,delivery_address:!0,billing_address:!0,business_credentials:!0}},invoice:{populate:{seller_business_credentials:!0,seller_company_address:!0,buyer_company_address:!0,buyer_delivery_address:!0,buyer_billing_address:!0,buyer_business_credentials:!0,items:!0,admin_items:!0}}},pagination:{pageSize:d||10,page:r?r+1:1}}),await s.fetchData(y.href)};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var
|
|
7
|
+
"use strict";var t=require("../../../node_modules/qs/lib/index.js"),e=require("../../lib/utils.js"),a=require("next/cache"),n=require("../services/get-token.js");const o=e.getStrapiURL();async function r(t){const a=await n.getAuthToken(),o={method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}};try{const n=await fetch(t,a?o:{}),r=await n.json();return e.flattenAttributes(r)}catch(t){throw console.error("Error fetching data:",t),t}}exports.fetchData=r,exports.getAllPages=async function(){a.unstable_noStore();const e=new URL("/api/pages",o);return e.search=t.default.stringify({populate:{blocks:{populate:"*"}}}),await r(e.href)},exports.getDisclaimerData=async function(){a.unstable_noStore();const e=new URL("/api/slugify/slugs/page/disclaimer?populate[blocks][populate]=%2A",o);return e.search=t.default.stringify({populate:{blocks:{populate:!0}}}),await r(e.href)},exports.getHomePageData=async function(){const e=new URL("/api/home-page",o);return e.search=t.default.stringify({populate:{blocks:{populate:{image:{populate:!0},link:{populate:!0},feature:{populate:!0}}}}}),await r(e.href)},exports.getNavigation=async function(){const t=new URL("/api/navigation/render/main-navigation?type=RFR",o);return await r(t.href)},exports.getPageNames=async function(){a.unstable_noStore();const e=new URL("/api/pages",o);return e.search=t.default.stringify({fields:["slug","title"]}),await r(e.href)},exports.getPrivacyPolicyData=async function(){a.unstable_noStore();const e=new URL("/api/slugify/slugs/page/privacy-policy?populate[blocks][populate]=%2A",o);return e.search=t.default.stringify({populate:{blocks:{populate:!0}}}),await r(e.href)},exports.getSiteData=async function(){a.unstable_noStore();const n=new URL("/api/public-information",o);n.search=t.default.stringify({populate:{socials:!0,business_credentials:!0,footer_logo:!0,header_logo:!0,address:!0}});const r={method:"GET",headers:{"Content-Type":"application/json"}};try{const t=await fetch(n,r),a=await t.json();return e.flattenAttributes(a)}catch(t){return console.error("Error fetching data:",t),null}};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var e=require("../../../../node_modules/qs/lib/index.js"),t=require("../../../lib/utils.js"),
|
|
7
|
+
"use strict";var e=require("../../../../node_modules/qs/lib/index.js"),t=require("../../../lib/utils.js"),n=require("next/cache");const o=t.getStrapiURL();exports.getSinglePage=async function(r){n.unstable_noStore(),console.log("getSinglePage",r),r||(r="home");const s=new URL(`/api/slugify/slugs/page/${r}`,o);s.search=e.default.stringify({populate:{blocks:{populate:"*"}}}),console.log(s.href);const a={method:"GET",headers:{"Content-Type":"application/json"}};try{const e=await fetch(s,a),n=await e.json();return t.flattenAttributes(n)}catch(e){return console.error("Error fetching data:",e),null}};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
"use strict";var
|
|
7
|
+
"use strict";var r=require("./get-token.js"),e=require("../../../node_modules/qs/lib/index.js"),t=require("../../lib/utils.js"),o=require("next/cache");const a=t.getStrapiURL(),n=e.default.stringify({populate:{customer_profile:{populate:"*"}}}),s=e.default.stringify({populate:"role"});exports.getExtendedUserMeLoader=async function(){o.unstable_noStore();const e=new URL("/api/users/me",a);e.search=n;const t=await r.getAuthToken();if(!t)return{ok:!1,data:null,error:null};try{const r=await fetch(e.href,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},cache:"no-cache"});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return o.error?{ok:!1,data:null,error:o.error}:{ok:!0,data:o,error:null}}catch(r){return console.error("getExtendedUserMeLoader Error:",r),{ok:!1,data:null,error:r}}},exports.getUserMeLoader=async function(r){const e=new URL("/api/users/me",a);e.search=n;try{const t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);if(t.ok)return t.json();throw new Error("Failed to fetch user details")}catch(r){return console.error("getUserMeLoader Error:",r),null}},exports.getUserRole=async function(){const e=new URL("/api/users/me",a);e.search=s;const t=await r.getAuthToken();if(!t)return{ok:!1,data:null,error:null};try{const r=await fetch(e.href,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},cache:"no-cache"});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const o=await r.json();return o.error?{ok:!1,data:null,error:o.error}:{ok:!0,data:o,error:null}}catch(r){return console.error("getUserRole Error:",r),{ok:!1,data:null,error:r}}};
|