Skip to content

Commit

Permalink
fix: user can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoUwu committed Feb 24, 2025
1 parent d9c876b commit 429cedd
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 33 deletions.
9 changes: 8 additions & 1 deletion vtex/loaders/payment/userPayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ async function loader(
}

try {
const data = await io.query<{ profile: { payments: Payment[] } }, null>(
const data = await io.query<
{ profile: { payments: Payment[] } | null },
null
>(
{ query },
{ headers: { cookie } },
);

if (!data.profile?.payments) {
return null;
}

return data.profile.payments;
} catch (e) {
console.error(e);
Expand Down
70 changes: 38 additions & 32 deletions vtex/manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import * as $$$$$$$$$17 from "./actions/masterdata/createDocument.ts";
import * as $$$$$$$$$18 from "./actions/masterdata/updateDocument.ts";
import * as $$$$$$$$$19 from "./actions/newsletter/subscribe.ts";
import * as $$$$$$$$$20 from "./actions/notifyme.ts";
import * as $$$$$$$$$21 from "./actions/review/submit.ts";
import * as $$$$$$$$$22 from "./actions/trigger.ts";
import * as $$$$$$$$$23 from "./actions/wishlist/addItem.ts";
import * as $$$$$$$$$24 from "./actions/wishlist/removeItem.ts";
import * as $$$$$$$$$21 from "./actions/payment/deletePaymentToken.ts";
import * as $$$$$$$$$22 from "./actions/review/submit.ts";
import * as $$$$$$$$$23 from "./actions/trigger.ts";
import * as $$$$$$$$$24 from "./actions/wishlist/addItem.ts";
import * as $$$$$$$$$25 from "./actions/wishlist/removeItem.ts";
import * as $$$$0 from "./handlers/sitemap.ts";
import * as $$$0 from "./loaders/cart.ts";
import * as $$$1 from "./loaders/categories/tree.ts";
Expand Down Expand Up @@ -56,18 +57,20 @@ import * as $$$24 from "./loaders/options/productIdByTerm.ts";
import * as $$$25 from "./loaders/orders/list.ts";
import * as $$$26 from "./loaders/paths/PDPDefaultPath.ts";
import * as $$$27 from "./loaders/paths/PLPDefaultPath.ts";
import * as $$$28 from "./loaders/product/extend.ts";
import * as $$$29 from "./loaders/product/extensions/detailsPage.ts";
import * as $$$30 from "./loaders/product/extensions/list.ts";
import * as $$$31 from "./loaders/product/extensions/listingPage.ts";
import * as $$$32 from "./loaders/product/extensions/suggestions.ts";
import * as $$$33 from "./loaders/product/wishlist.ts";
import * as $$$34 from "./loaders/promotion/getPromotionById.ts";
import * as $$$35 from "./loaders/proxy.ts";
import * as $$$36 from "./loaders/user.ts";
import * as $$$37 from "./loaders/wishlist.ts";
import * as $$$38 from "./loaders/workflow/product.ts";
import * as $$$39 from "./loaders/workflow/products.ts";
import * as $$$28 from "./loaders/payment/paymentSystems.ts";
import * as $$$29 from "./loaders/payment/userPayments.ts";
import * as $$$30 from "./loaders/product/extend.ts";
import * as $$$31 from "./loaders/product/extensions/detailsPage.ts";
import * as $$$32 from "./loaders/product/extensions/list.ts";
import * as $$$33 from "./loaders/product/extensions/listingPage.ts";
import * as $$$34 from "./loaders/product/extensions/suggestions.ts";
import * as $$$35 from "./loaders/product/wishlist.ts";
import * as $$$36 from "./loaders/promotion/getPromotionById.ts";
import * as $$$37 from "./loaders/proxy.ts";
import * as $$$38 from "./loaders/user.ts";
import * as $$$39 from "./loaders/wishlist.ts";
import * as $$$40 from "./loaders/workflow/product.ts";
import * as $$$41 from "./loaders/workflow/products.ts";
import * as $$$$$$0 from "./sections/Analytics/Vtex.tsx";
import * as $$$$$$$$$$0 from "./workflows/events.ts";
import * as $$$$$$$$$$1 from "./workflows/product/index.ts";
Expand Down Expand Up @@ -102,18 +105,20 @@ const manifest = {
"vtex/loaders/orders/list.ts": $$$25,
"vtex/loaders/paths/PDPDefaultPath.ts": $$$26,
"vtex/loaders/paths/PLPDefaultPath.ts": $$$27,
"vtex/loaders/product/extend.ts": $$$28,
"vtex/loaders/product/extensions/detailsPage.ts": $$$29,
"vtex/loaders/product/extensions/list.ts": $$$30,
"vtex/loaders/product/extensions/listingPage.ts": $$$31,
"vtex/loaders/product/extensions/suggestions.ts": $$$32,
"vtex/loaders/product/wishlist.ts": $$$33,
"vtex/loaders/promotion/getPromotionById.ts": $$$34,
"vtex/loaders/proxy.ts": $$$35,
"vtex/loaders/user.ts": $$$36,
"vtex/loaders/wishlist.ts": $$$37,
"vtex/loaders/workflow/product.ts": $$$38,
"vtex/loaders/workflow/products.ts": $$$39,
"vtex/loaders/payment/paymentSystems.ts": $$$28,
"vtex/loaders/payment/userPayments.ts": $$$29,
"vtex/loaders/product/extend.ts": $$$30,
"vtex/loaders/product/extensions/detailsPage.ts": $$$31,
"vtex/loaders/product/extensions/list.ts": $$$32,
"vtex/loaders/product/extensions/listingPage.ts": $$$33,
"vtex/loaders/product/extensions/suggestions.ts": $$$34,
"vtex/loaders/product/wishlist.ts": $$$35,
"vtex/loaders/promotion/getPromotionById.ts": $$$36,
"vtex/loaders/proxy.ts": $$$37,
"vtex/loaders/user.ts": $$$38,
"vtex/loaders/wishlist.ts": $$$39,
"vtex/loaders/workflow/product.ts": $$$40,
"vtex/loaders/workflow/products.ts": $$$41,
},
"handlers": {
"vtex/handlers/sitemap.ts": $$$$0,
Expand Down Expand Up @@ -143,10 +148,11 @@ const manifest = {
"vtex/actions/masterdata/updateDocument.ts": $$$$$$$$$18,
"vtex/actions/newsletter/subscribe.ts": $$$$$$$$$19,
"vtex/actions/notifyme.ts": $$$$$$$$$20,
"vtex/actions/review/submit.ts": $$$$$$$$$21,
"vtex/actions/trigger.ts": $$$$$$$$$22,
"vtex/actions/wishlist/addItem.ts": $$$$$$$$$23,
"vtex/actions/wishlist/removeItem.ts": $$$$$$$$$24,
"vtex/actions/payment/deletePaymentToken.ts": $$$$$$$$$21,
"vtex/actions/review/submit.ts": $$$$$$$$$22,
"vtex/actions/trigger.ts": $$$$$$$$$23,
"vtex/actions/wishlist/addItem.ts": $$$$$$$$$24,
"vtex/actions/wishlist/removeItem.ts": $$$$$$$$$25,
},
"workflows": {
"vtex/workflows/events.ts": $$$$$$$$$$0,
Expand Down

0 comments on commit 429cedd

Please sign in to comment.