From f09604a8639d2e950a53a792901f811a7f51b430 Mon Sep 17 00:00:00 2001 From: ApMatheus Date: Wed, 18 Dec 2024 11:43:37 -0300 Subject: [PATCH 1/3] fix: sku is replaced by product ID --- konfidency/actions/submitReviews.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/konfidency/actions/submitReviews.ts b/konfidency/actions/submitReviews.ts index d306ec18a..fae1c596a 100644 --- a/konfidency/actions/submitReviews.ts +++ b/konfidency/actions/submitReviews.ts @@ -4,20 +4,20 @@ import { logger } from "@deco/deco/o11y"; export interface Props { /** - * @title Product SKU + * @title Product Id */ - sku: string; + id: string; review: WriteReview; } export default async function action(props: Props, _req: Request, ctx: AppContext): Promise { const { customer, api } = ctx - const { review, sku } = props + const { review, id } = props try { const response = await api[`POST /:customer/:sku/review`]({ - sku: sku, + sku: id, customer, }, { body: { From 730f72bbdf10764ae64f2be4dde4e58ea1a4eb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Gaudencio=20do=20R=C3=AAgo?= Date: Tue, 21 Jan 2025 10:16:32 -0300 Subject: [PATCH 2/3] Update submitReviews.ts --- konfidency/actions/submitReviews.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/konfidency/actions/submitReviews.ts b/konfidency/actions/submitReviews.ts index ec751f931..35af35b10 100644 --- a/konfidency/actions/submitReviews.ts +++ b/konfidency/actions/submitReviews.ts @@ -6,7 +6,7 @@ export interface Props { /** * @title Product Id */ - id: string; + sku: string; review: WriteReview; } @@ -16,11 +16,11 @@ export default async function action( ctx: AppContext, ): Promise { const { customer, api } = ctx; - const { review, id } = props + const { review, sku } = props try { const response = await api[`POST /:customer/:sku/review`]({ - sku: id, + sku, customer, }, { body: { From 928dd8489eea3fa73a9233063110df21716d4da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Gaudencio=20do=20R=C3=AAgo?= Date: Tue, 21 Jan 2025 10:16:57 -0300 Subject: [PATCH 3/3] Update submitReviews.ts --- konfidency/actions/submitReviews.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/konfidency/actions/submitReviews.ts b/konfidency/actions/submitReviews.ts index 35af35b10..6168c7bf6 100644 --- a/konfidency/actions/submitReviews.ts +++ b/konfidency/actions/submitReviews.ts @@ -16,11 +16,11 @@ export default async function action( ctx: AppContext, ): Promise { const { customer, api } = ctx; - const { review, sku } = props + const { review, sku } = props; try { const response = await api[`POST /:customer/:sku/review`]({ - sku, + sku: sku, customer, }, { body: {