umwd-components 0.1.686 → 0.1.687
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/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/ieee754/index.js +1 -1
- package/dist/src/components/e-commerce/products/EditStockForm.js +1 -1
- package/dist/src/components/logistics/report/ReportMakingComponent.js +1 -1
- package/dist/src/components/logistics/report/ReportsDisplay.js +1 -1
- package/dist/src/data/actions/logistics/report/createReportAction.js +1 -1
- package/dist/src/data/loaders/user/getUserMeLoader.js +7 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/data/actions/logistics/report/createReportAction.d.ts +1 -1
- package/dist/types/data/loaders/user/getUserMeLoader.d.ts +10 -0
- package/dist/types/types/logistics/Report.d.ts +2 -0
- package/dist/types/types/user.d.ts +14 -0
- package/package.json +1 -1
- package/src/components/e-commerce/products/EditStockForm.tsx +10 -7
- package/src/components/logistics/report/ReportMakingComponent.tsx +49 -6
- package/src/components/logistics/report/ReportsDisplay.tsx +48 -7
- package/src/data/actions/logistics/report/createReportAction.ts +3 -1
- package/src/data/loaders/user/getUserMeLoader.ts +49 -0
- package/src/types/logistics/Report.ts +2 -0
- package/src/types/user.ts +15 -0
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__exports as r}from"../../_virtual/
|
|
6
|
+
import{__exports as r}from"../../_virtual/index8.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__exports as a}from"../../_virtual/
|
|
6
|
+
import{__exports as a}from"../../_virtual/index7.js";
|
|
7
7
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var t;function o(){return t||(t=1,a.read=function(a,t,o,r,h){var M,e,i=8*h-r-1,p=(1<<i)-1,f=p>>1,n=-7,w=o?h-1:0,s=o?-1:1,u=a[t+w];for(w+=s,M=u&(1<<-n)-1,u>>=-n,n+=i;n>0;M=256*M+a[t+w],w+=s,n-=8);for(e=M&(1<<-n)-1,M>>=-n,n+=r;n>0;e=256*e+a[t+w],w+=s,n-=8);if(0===M)M=1-f;else{if(M===p)return e?NaN:1/0*(u?-1:1);e+=Math.pow(2,r),M-=f}return(u?-1:1)*e*Math.pow(2,M-r)},a.write=function(a,t,o,r,h,M){var e,i,p,f=8*M-h-1,n=(1<<f)-1,w=n>>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:M-1,N=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,e=n):(e=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-e))<1&&(e--,p*=2),(t+=e+w>=1?s/p:s*Math.pow(2,1-w))*p>=2&&(e++,p/=2),e+w>=n?(i=0,e=n):e+w>=1?(i=(t*p-1)*Math.pow(2,h),e+=w):(i=t*Math.pow(2,w-1)*Math.pow(2,h),e=0));h>=8;a[o+u]=255&i,u+=N,i/=256,h-=8);for(e=e<<h|i,f+=h;f>0;a[o+u]=255&e,u+=N,e/=256,f-=8);a[o+u-N]|=128*_}),a}export{o as __require};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n}from"react";import l from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Typography";import{SubmitButton as o}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{updateProductAction as c}from"../../../data/actions/e-commerce/product/updateProductAction.js";import d from"@mui/material/Grid";import s from"../../logistics/report/ReportsDisplay.js";import E from"../../logistics/report/ReportMakingComponent.js";import{useSnackbar as p}from"../../../context/common/SnackbarContext.js";import y from"@mui/material/Table";import f from"@mui/material/TableBody";import g from"@mui/material/TableCell";import _ from"@mui/material/TableContainer";import v from"@mui/material/TableFooter";import k from"@mui/material/TableHead";import q from"@mui/material/TableRow";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import{AmountIndicator as h}from"../../common/AmountIndicator.js";var T={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function C(C){var S=C.data,j=C.revalidateCallback,Q=C.handleClose,V=C.sx,O=S.id,R=S.title;S.product_number,S.stock;var
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n}from"react";import l from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Typography";import{SubmitButton as o}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{updateProductAction as c}from"../../../data/actions/e-commerce/product/updateProductAction.js";import d from"@mui/material/Grid";import s from"../../logistics/report/ReportsDisplay.js";import E from"../../logistics/report/ReportMakingComponent.js";import{useSnackbar as p}from"../../../context/common/SnackbarContext.js";import y from"@mui/material/Table";import f from"@mui/material/TableBody";import g from"@mui/material/TableCell";import _ from"@mui/material/TableContainer";import v from"@mui/material/TableFooter";import k from"@mui/material/TableHead";import q from"@mui/material/TableRow";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import{AmountIndicator as h}from"../../common/AmountIndicator.js";var T={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function C(C){var S=C.data,j=C.revalidateCallback,Q=C.handleClose,V=C.sx,O=S.id,R=S.title;S.product_number,S.stock;var w=S.ipos,A=S.opos,I=S.reports,N=p().handleAddMessage,z=e(u(c,T),2),B=z[0],D=z[1];return n((function(){(null==B?void 0:B.message)&&(N({message:B.message,severity:B.severity||"error"}),"success"===B.severity&&(j&&j(),Q&&Q()))}),[null==B?void 0:B.message,N,j,Q]),n((function(){(null==B?void 0:B.strapiErrors)&&N({message:B.strapiErrors.message||"Error updating stock",severity:"error"})}),[null==B?void 0:B.strapiErrors,N]),r.createElement(a,{sx:t([],e(Array.isArray(V)?V:[V]),!1)},r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12},r.createElement(i,{variant:"h6"},R)),r.createElement(d,{item:!0,xs:12},r.createElement(_,{component:l},r.createElement(i,{variant:"h6",sx:{pl:2}},"Incoming orders"),r.createElement(y,{size:"small"},r.createElement(k,null,r.createElement(q,null,r.createElement(g,null,"Number"),r.createElement(g,null,"Order Date"),r.createElement(g,null,"Line Item Number"),r.createElement(g,null,"Ordered Quantity"),r.createElement(g,null,"Received Quantity"),r.createElement(g,null,"Registered Quantity"),r.createElement(g,null,"Released Quantity"))),r.createElement(f,null,w.map((function(e){return r.createElement(r.Fragment,null,e.items.map((function(t){return r.createElement(q,{key:e.id},r.createElement(g,null,e.ipo_number),r.createElement(g,null,e.order_date),r.createElement(g,null,t.line_item_number),r.createElement(g,null,r.createElement(h,{value:t.ordered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.received_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.registered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.released_quantity,maxValue:t.ordered_quantity,color:"primary"})))})))}))),r.createElement(v,null,r.createElement(q,null,r.createElement(g,{colSpan:6,align:"right"},"Total added to stock:"),r.createElement(g,null,w.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0))))),r.createElement(i,{variant:"h6",sx:{pl:2}},"Outgoing orders"),r.createElement(y,{size:"small"},r.createElement(k,null,r.createElement(q,null,r.createElement(g,null,"Number"),r.createElement(g,null,"Order Date"),r.createElement(g,null,"Line Item Number"),r.createElement(g,null,"Ordered Quantity"),r.createElement(g,null,"Picked Quantity"),r.createElement(g,null,"Packed Quantity"),r.createElement(g,null,"Shipped Quantity"))),r.createElement(f,null,A.map((function(e){return r.createElement(r.Fragment,null,e.opo_items.map((function(t){return r.createElement(q,{key:e.id},r.createElement(g,null,e.opo_number),r.createElement(g,null,e.order_date),r.createElement(g,null,t.line_item_number),r.createElement(g,null,r.createElement(h,{value:t.ordered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.picked_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.packed_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.shipped_quantity,maxValue:t.ordered_quantity,color:"primary"})))})))}))),r.createElement(v,null,r.createElement(q,null,r.createElement(g,{colSpan:3,align:"right"},"Total reduced from stock:"),r.createElement(g,null,A.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0))))),r.createElement(y,{size:"small"},r.createElement(q,null,r.createElement(g,{align:"right"},"Total added to stock:"),r.createElement(g,null,w.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0))),r.createElement(q,null,r.createElement(g,{align:"right"},"Total reduced from stock:"),r.createElement(g,null,A.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0))),r.createElement(q,null,r.createElement(g,{align:"right"},"Corrections:"),r.createElement(g,null,r.createElement(b,{title:"Total stock corrections"},r.createElement(i,null,I?I.reduce((function(e,t){return e+t.quantity}),0):0))),r.createElement(g,null,r.createElement(b,{title:"Total stock corrections after updating"},r.createElement("b",null,I?I.reduce((function(e,t){return e+t.quantity}),0):0)))),r.createElement(q,null,r.createElement(g,{align:"right"},"Stock:"),r.createElement(g,null,r.createElement(b,{title:"Total stock"},r.createElement(i,null,w.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0)-A.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0)+(I?I.reduce((function(e,t){return e+t.quantity}),0):0)))),r.createElement(g,null,r.createElement(b,{title:"Total stock after updating"},r.createElement("b",null,w.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0)-A.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0)+(I?I.reduce((function(e,t){return e+t.quantity}),0):0))))))))),r.createElement("form",{action:D},O&&r.createElement("input",{id:"id",type:"hidden",name:"id",value:O}),r.createElement("input",{id:"stock_reports",type:"hidden",name:"stock_reports",value:JSON.stringify(I)}),r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12,sx:{mt:2}},r.createElement(m,{spacing:2},r.createElement(i,{variant:"h5"},"Stock corrections"),r.createElement(i,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"),r.createElement(s,{reports:I}),r.createElement(m,{direction:"row",justifyContent:"flex-end"},r.createElement(E,{content:"content",quantity:0,type:"stock",related:[{id:O,__type:"api::e-commerce.product"}],revalidateCallback:j})))),r.createElement(d,{item:!0,xs:12},r.createElement(m,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{py:1}},Q&&r.createElement(x,{onClick:Q,variant:"outlined"},"Close"),r.createElement(o,{text:"Update Stock",loadingText:"Updating...",variant:"contained"}))))))}export{C as EditStockForm};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import
|
|
6
|
+
import{__read as e,__awaiter as t,__generator as r}from"../../../../node_modules/tslib/tslib.es6.js";import o,{useState as a,useEffect as n}from"react";import i from"@mui/material/Alert";import m from"@mui/material/IconButton";import l from"@mui/material/Dialog";import s from"@mui/material/DialogContent";import u from"@mui/material/DialogActions";import c from"@mui/material/Button";import d from"@mui/material/Typography";import p from"@mui/material/Stack";import f from"@mui/material/TextField";import g from"../../../../node_modules/dayjs/dayjs.min.js";import{SubmitButton as E}from"../../SubmitButton.js";import{StrapiErrors as v}from"../../StrapiErrors.js";import{useFormState as b}from"react-dom";import{createReportAction as y}from"../../../data/actions/logistics/report/createReportAction.js";import x from"../../common/markdown/MarkdownEditor.js";import h from"@mui/icons-material/Announcement";import{Box as j,Tooltip as k}from"@mui/material";import{getUserMeLoader as A}from"../../../data/loaders/user/getUserMeLoader.js";import{useSnackbar as C}from"../../../context/common/SnackbarContext.js";var D={zodErrors:null,strapiErrors:null,data:null,message:null};function S(S){var w=S.content,M=S.related,T=S.type,V=S.minValue,Y=S.maxValue,z=S.revalidateCallback,B=e(a(!1),2),F=B[0],q=B[1],I=e(a(null),2),L=I[0],P=I[1],U=y.bind(null,M,T),W=e(b(U,D),2),_=W[0],R=W[1],G=C().handleAddMessage;return n((function(){(null==_?void 0:_.message)&&(G({message:_.message,severity:_.severity||"error"}),"success"===_.severity&&(z&&z(),q(!1)))}),[null==_?void 0:_.message]),n((function(){!function(){t(this,void 0,void 0,(function(){var e,t,o,a;return r(this,(function(r){switch(r.label){case 0:return[4,A()];case 1:return e=r.sent(),t=e.ok,o=e.data,a=e.error,t&&o?(console.log("Current User:",o),P(o)):(P(null),console.error("Error fetching current user:",a)),[2]}}))}))}()}),[]),o.createElement(o.Fragment,null,o.createElement(j,{sx:{display:"block",position:"relative"}},o.createElement(k,{title:"Create a report"},o.createElement(m,{onClick:function(){return q(!0)}},o.createElement(h,{fontSize:"large"})))),o.createElement(l,{open:F,fullWidth:!0,maxWidth:"lg"},o.createElement("form",{action:R},o.createElement(s,{sx:{p:1}}," ",o.createElement(p,{spacing:2},o.createElement(d,{variant:"body1",textAlign:"right"},g(Date.now()).format("DD-MM-YYYY")),o.createElement(f,{id:"quantity",name:"quantity",type:"number",label:"Amount",size:"small",InputProps:{inputProps:{min:"".concat(void 0!==V&&void 0!==Y&&V<Y?V:Y),max:"".concat(void 0!==V&&void 0!==Y&&Y>V?Y:V),step:"1"}},defaultValue:0,helperText:V&&Y&&"Enter a number between ".concat(V," and ").concat(Y)}),o.createElement(x,{name:"content",label:"The report",defaultValue:w}),null!==L&&o.createElement(o.Fragment,null,o.createElement(d,{variant:"body1",textAlign:"right"},L.username),o.createElement(d,{variant:"body2",textAlign:"right"},L.email)))),o.createElement(u,null,o.createElement(c,{onClick:function(){return q(!1)}},"Cancel"),o.createElement(E,{text:"Submit",loadingText:"Loading..."}),o.createElement(v,{error:null==_?void 0:_.strapiErrors}),(null==_?void 0:_.message)&&o.createElement(i,{severity:"error"},null==_?void 0:_.message)))))}export{S as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import e from"react";import t from"@mui/material/Typography";import
|
|
6
|
+
import e from"react";import t from"@mui/material/Typography";import a from"@mui/material/Stack";import r from"@mui/material/Chip";import n from"@mui/material/Grid";import m from"../../common/markdown/MarkdownDisplay.js";import{Divider as i}from"@mui/material";var l=function(l){var s=l.reports;return e.createElement(a,{spacing:1,sx:{mb:1}},s&&s.length>0&&s.map((function(l,s){return e.createElement(n,{container:!0,key:s},e.createElement(n,{item:!0,xs:1,sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},e.createElement(r,{label:"".concat(l.quantity>0?"+":""," ").concat(l.quantity),color:l.quantity>0?"success":"error",size:"small"})),e.createElement(n,{item:!0,xs:7,sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},e.createElement(m,null,l.content)),e.createElement(n,{item:!0,xs:2,sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},e.createElement(t,{variant:"body2"}," ",l.date)),e.createElement(n,{item:!0,xs:2,sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},e.createElement(a,{direction:"column",alignItems:"flex-end"},l.signature_username&&e.createElement(t,{variant:"body1"},l.signature_username),l.signature_username&&e.createElement(t,{variant:"body2"},l.signature_email))),e.createElement(n,{item:!0,xs:12},e.createElement(i,{sx:{my:1}})))})))};export{l as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__awaiter as r,__generator as e,__assign as t}from"../../../../../node_modules/tslib/tslib.es6.js";import{mutateData as s}from"../../../services/mutate-data.js";import{flattenAttributes as o}from"../../../../lib/utils.js";import{parseFormData as a}from"../../../../lib/parseFormData.js";function i(i,n,l){return r(this,void 0,void 0,(function(){var r,
|
|
7
|
+
import{__awaiter as r,__generator as e,__assign as t}from"../../../../../node_modules/tslib/tslib.es6.js";import{mutateData as s}from"../../../services/mutate-data.js";import{flattenAttributes as o}from"../../../../lib/utils.js";import{parseFormData as a}from"../../../../lib/parseFormData.js";function i(i,n,l,p){return r(this,void 0,void 0,(function(){var r,m,u,c;return e(this,(function(e){switch(e.label){case 0:return r=a(p),m={data:t(t({},r.data),{related:i,type:n})},console.log("reportData",m),[4,s("POST","/api/reports",m)];case 1:return u=e.sent(),console.log("responseData",u),u?u.error?[2,t(t({},l),{strapiErrors:u.error,message:"Failed to Create Report."})]:(c=o(u),[2,t(t({},l),{message:"New Report Created",severity:"success",data:c,strapiErrors:null})]):[2,t(t({},l),{strapiErrors:null,message:"Ops! Something went wrong. Please try again."})]}}))}))}export{i as createReportAction};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
/*
|
|
3
|
+
* UMWD-Components
|
|
4
|
+
* @copyright Jelle Paulus
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import{__awaiter as r,__generator as e}from"../../../../node_modules/tslib/tslib.es6.js";import{getAuthToken as t}from"../../services/get-token.js";import o from"../../../../node_modules/qs/lib/index.js";import{getStrapiURL as s,flattenAttributes as n}from"../../../lib/utils.js";import{unstable_noStore as a}from"next/cache";var i=s(),c=o.stringify({fields:["id","username","email","createdAt","updatedAt"]});function u(){return r(this,arguments,void 0,(function(r){var o,s,u,l,d;return void 0===r&&(r=c),e(this,(function(e){switch(e.label){case 0:return a(),(o=new URL("/api/users/me",i)).search=r,[4,t()];case 1:if(!(s=e.sent()))return[2,{ok:!1,data:null,error:null}];e.label=2;case 2:return e.trys.push([2,5,,6]),[4,fetch(o.href,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},cache:"no-cache"})];case 3:if(!(u=e.sent()).ok)throw new Error("HTTP error! status: ".concat(u.status));return[4,u.json()];case 4:return(l=e.sent()).error?[2,{ok:!1,data:null,error:l.error}]:[2,{ok:!0,data:n(l),error:null}];case 5:return d=e.sent(),console.error("getUserMeLoader Error:",d),[2,{ok:!1,data:null,error:d}];case 6:return[2]}}))}))}export{u as getUserMeLoader};
|