From 8eb10f493fed093fcc8716059002d3b86cb7249b Mon Sep 17 00:00:00 2001 From: Filipe Soccol Date: Wed, 21 May 2025 10:43:00 -0300 Subject: [PATCH] Adjusted request for create participants. --- README.md | 7 ++++ .../SellerSteps/SellerComponent.vue | 18 +--------- src/utils/bbPay.ts | 33 +++++++++++++------ 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index ee195f9..e5c9026 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,10 @@ cd P2Pix-Front-End # Run docker-compose up command docker-compose up ``` + +### Backend Communication + +Backend Repo: `https://gitea.kosmos.org/hueso/helpix` + +Backend Endpoint: `https://api.p2pix.co/release/1279331` + diff --git a/src/components/SellerSteps/SellerComponent.vue b/src/components/SellerSteps/SellerComponent.vue index 8817ac1..fe8d3d6 100644 --- a/src/components/SellerSteps/SellerComponent.vue +++ b/src/components/SellerSteps/SellerComponent.vue @@ -26,7 +26,6 @@ const formRef = ref(null); const user = useUser(); const { walletAddress, selectedToken } = user; -const fullName = ref(""); const offer = ref(""); const identification = ref(""); const account = ref(""); @@ -72,7 +71,7 @@ const handleSubmit = (e: Event): void => { const data: Participant = { offer: offer.value, - fullName: fullName.value, + chainID: user.networkId.value, identification: processedIdentification, bankIspb: selectedBank.value?.ISPB, accountType: accountType.value, @@ -185,21 +184,6 @@ const handleSelectedToken = (token: TokenEnum): void => { - - -
- -
{ - const response = await fetch(`${process.env.VUE_APP_API_URL}/participants`, { - method: "PUT", - body: JSON.stringify(participant), - }); + console.log("Creating participant", participant); + const response = await fetch( + `${import.meta.env.VITE_APP_API_URL}/participants`, + { + method: "PUT", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(participant), + } + ); const data = await response.json(); return { ...participant, id: data.id } as ParticipantWithID; }; export const createSolicitation = async (offer: Offer) => { - const response = await fetch(`${process.env.VUE_APP_API_URL}/solicitation`, { - method: "POST", - body: JSON.stringify(offer), - }); + const response = await fetch( + `${import.meta.env.VITE_APP_API_URL}/solicitation`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(offer), + } + ); return response.json(); }; export const getSolicitation = async (id: string) => { const response = await fetch( - `${process.env.VUE_APP_API_URL}/solicitation/${id}` + `${import.meta.env.VITE_APP_API_URL}/solicitation/${id}` ); const obj: any = response.json();