From 4e1e0dbbf0ef9acd981229ec5d2e6b8c17f0e01b Mon Sep 17 00:00:00 2001
From: piyush-bitpack
Date: Wed, 3 Jan 2024 15:15:21 +0530
Subject: [PATCH] changes route
---
src/api/constants.ts | 1 +
src/components/card/index.tsx | 2 +-
src/features/dapp/dapp_api.ts | 7 +++++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/api/constants.ts b/src/api/constants.ts
index df65106..aeeb074 100644
--- a/src/api/constants.ts
+++ b/src/api/constants.ts
@@ -19,6 +19,7 @@ export const ApiEndpoints = {
SEARCH_BY_PKG_ID: "dapp/queryWithPackageId",
REVIEWS: "reviews",
RATING: "dapp/rate",
+ POSTRATING: "dapp/newRate",
FETCH_USER: "fetchuser",
POST_USER: "postuser",
SEARCH: "dapp/search",
diff --git a/src/components/card/index.tsx b/src/components/card/index.tsx
index f3a029c..b7fb4c2 100644
--- a/src/components/card/index.tsx
+++ b/src/components/card/index.tsx
@@ -66,7 +66,7 @@ export function ReviewCard(props) {
{review.userId}
•{" "}
- {`${date.getDate()}/${date.getMonth()}/${date.getFullYear()}`}
+ {`${date.getDate()}/${date.getMonth()+1}/${date.getFullYear()}`}
diff --git a/src/features/dapp/dapp_api.ts b/src/features/dapp/dapp_api.ts
index 7bf3c84..c071c1e 100644
--- a/src/features/dapp/dapp_api.ts
+++ b/src/features/dapp/dapp_api.ts
@@ -184,14 +184,17 @@ export class DappDataSource implements IDappDataSource {
postReview(builder: EndpointBuilder) {
return builder.mutation({
query: ({ ...body }) => {
+ const newBody = {...body}
+ delete newBody?.signature
+ delete newBody?.message
return {
- url: `${ApiEndpoints.RATING}`,
+ url: `${ApiEndpoints.POSTRATING}`,
headers: {
'x-message': body?.message,
'x-signature': body?.signature
},
method: "POST",
- body: body,
+ body: newBody,
};
},
});