Skip to content

Commit

Permalink
fix: some fixes added
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx committed Aug 22, 2024
1 parent 353e67f commit e091b74
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 17 deletions.
6 changes: 3 additions & 3 deletions components/header/Buttons/Cart/linx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Button from "./common.tsx";

function CartButton() {
const { loading, cart } = useCart();
const cartSize = cart.value?.Basket?.Items?.length || 0;
const products = cart.value?.Basket?.Items;
const coupon = cart.value?.Basket?.Coupons?.[0]?.Code;
const cartSize = cart.value?.Shopper?.Basket?.Items?.length || 0;
const products = cart.value?.Shopper?.Basket?.Items;
const coupon = cart.value?.Shopper?.Basket?.Coupons?.[0]?.Code;

return (
<Button
Expand Down
8 changes: 4 additions & 4 deletions components/minicart/linx/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import BaseCart from "../common/Cart.tsx";

function Cart() {
const { cart, loading, updateItem, addCoupon } = useCart();
const items = cart.value?.Basket?.Items ?? [];
const items = cart.value?.Shopper?.Basket?.Items ?? [];

const total = cart.value?.Basket?.Total ?? 0;
const subtotal = cart.value?.Basket?.SubTotal ?? 0;
const total = cart.value?.Shopper?.Basket?.Total ?? 0;
const subtotal = cart.value?.Shopper?.Basket?.SubTotal ?? 0;
const locale = "pt-BR";
const currency = "BRL";
const coupon = cart.value?.Basket?.Coupons?.[0]?.Code ?? undefined;
const coupon = cart.value?.Shopper?.Basket?.Coupons?.[0]?.Code ?? undefined;

return (
<BaseCart
Expand Down
8 changes: 5 additions & 3 deletions components/product/AddToCartButton/linx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ function AddToCartButton({ productGroupID, productID, eventParams }: Props) {
eventParams={eventParams}
onAddItem={() =>
addItem({
ProductID: productGroupID,
SkuID: productID,
Quantity: 1,
Products: [{
ProductID: productGroupID,
SkuID: productID,
Quantity: 1,
}],
})}
/>
);
Expand Down
33 changes: 29 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,42 @@
"imports": {
"deco-sites/maconequiio/": "./",
"$store/": "./",
"deco/": "https://denopkg.com/deco-cx/deco@1.81.2/",
"apps/": "https://denopkg.com/deco-cx/apps@0.53.5/",
"$fresh/": "https://deno.land/x/[email protected].3/",
"deco/": "https://denopkg.com/deco-cx/deco@1.92.2/",
"apps/": "https://denopkg.com/deco-cx/apps@0.56.3/",
"$fresh/": "https://deno.land/x/[email protected].8/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"preact-render-to-string": "https://esm.sh/*[email protected]",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"std/": "https://deno.land/[email protected]/",
"partytown/": "https://denopkg.com/deco-cx/[email protected]/",
"daisyui": "npm:[email protected]"
"daisyui": "npm:[email protected]",
"@cliffy/prompt": "jsr:@cliffy/prompt@^1.0.0-rc.5",
"@core/asyncutil": "jsr:@core/asyncutil@^1.0.2",
"@deco/durable": "jsr:@deco/durable@^0.5.3",
"@deco/warp": "jsr:@deco/warp@^0.3.4",
"@hono/hono": "jsr:@hono/hono@^4.5.4",
"@std/assert": "jsr:@std/assert@^1.0.2",
"@std/async": "jsr:@std/async@^0.224.1",
"@std/cli": "jsr:@std/cli@^1.0.3",
"@std/crypto": "jsr:@std/[email protected]",
"@std/datetime": "jsr:@std/datetime@^0.224.0",
"@std/encoding": "jsr:@std/encoding@^1.0.0-rc.1",
"@std/flags": "jsr:@std/flags@^0.224.0",
"@std/fmt": "jsr:@std/fmt@^0.225.3",
"@std/fs": "jsr:@std/fs@^0.229.1",
"@std/http": "jsr:@std/http@^1.0.0",
"@std/io": "jsr:@std/io@^0.224.4",
"@std/log": "jsr:@std/log@^0.224.5",
"@std/media-types": "jsr:@std/media-types@^1.0.0-rc.1",
"@std/path": "jsr:@std/path@^0.225.2",
"@std/semver": "jsr:@std/semver@^0.224.3",
"@std/streams": "jsr:@std/streams@^1.0.0",
"@std/testing": "jsr:@std/testing@^1.0.0",
"@zaubrik/djwt": "jsr:@zaubrik/djwt@^3.0.2",
"fast-json-patch": "npm:fast-json-patch@^3.1.1",
"simple-git": "npm:simple-git@^3.25.0"
},
"tasks": {
"start": "deno task bundle && deno run -A --unstable --env --watch=tailwind.css,sections/,functions/,loaders/,actions/,workflows/,accounts/,.env dev.ts",
Expand Down
2 changes: 1 addition & 1 deletion fresh.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "$fresh/server.ts";
import plugins from "https://denopkg.com/deco-sites/std@1.24.2/plugins/mod.ts";
import plugins from "https://denopkg.com/deco-sites/std@1.26.8/plugins/mod.ts";
import manifest from "./manifest.gen.ts";
import tailwind from "./tailwind.config.ts";

Expand Down
2 changes: 0 additions & 2 deletions loaders/Blog/BlogPostPageImproved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default async function BlogPostPageLoader(
ACCESSOR,
);

console.log("Records:", records);

if (!records || records.length === 0) {
console.error("No records found");
return null;
Expand Down

0 comments on commit e091b74

Please sign in to comment.