Skip to content

Commit

Permalink
fix: bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
georgetonietti committed Dec 11, 2024
1 parent 0ee1fad commit 779607f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/shipping/Results.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { AppContext } from "../../apps/deco/wake.ts";
import { ComponentProps } from "../../sections/Component.tsx";
import { type ComponentProps } from "../../sections/Component.tsx";
import { ShippingQuotesQuery } from "apps/wake/utils/graphql/storefront.graphql.gen.ts";
import type { Props as SKU } from "apps/wake/actions/shippingSimulation.ts";

Expand All @@ -14,9 +14,8 @@ function formatShippingEstimate(estimate: number): string {

export async function action(props: Props, req: Request, ctx: AppContext) {
const form = await req.formData();

try {
const result = await (ctx as any).invoke.wake.actions.review.create({
const result = await (ctx as any).invoke.wake.actions.shippingSimulation({
...props.items[0],
cep: `${form.get("postalCode") ?? ""}`,
}) as ShippingQuotesQuery["shippingQuotes"];
Expand All @@ -41,10 +40,10 @@ export default function Results({ result }: ComponentProps<typeof action>) {
<ul class="flex flex-col gap-4 p-4 border border-base-400 rounded">
{result?.map((method) => (
<li key={method?.id} class="grid grid-cols-3 justify-items-center items-center gap-2 border-base-200 not-first-child:border-t">
<span class="text-button">
<span class="text-button text-center">
Entrega {method?.name}
</span>
<span class="text-button">
<span class="text-button text-center">
até {formatShippingEstimate(method!.deadline)}
</span>
<span class="text-base font-semibold text-right">
Expand Down

0 comments on commit 779607f

Please sign in to comment.