@techsio/storefront-data
Version:
Medusa-first storefront data layer built on TanStack Query.
11 lines (10 loc) • 320 B
JavaScript
const getErrorStatus = (error)=>{
if (!error || "object" != typeof error) return;
const err = error;
return err.status ?? err.response?.status;
};
const isAuthError = (error)=>{
const status = getErrorStatus(error);
return 401 === status || 403 === status;
};
export { getErrorStatus, isAuthError };