From a2ceabd13d1ef7a3bf3f5bfef3263886b38a03b8 Mon Sep 17 00:00:00 2001 From: oghene-ella Date: Sun, 22 Oct 2023 21:09:40 +0100 Subject: [PATCH] fixed the endpoint --- components/Modals/ComplaintModal.tsx | 12 ++++++------ pages/user/customer-purchase-dashboard/index.tsx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/Modals/ComplaintModal.tsx b/components/Modals/ComplaintModal.tsx index 196d51ee1..461c04e23 100644 --- a/components/Modals/ComplaintModal.tsx +++ b/components/Modals/ComplaintModal.tsx @@ -22,20 +22,20 @@ interface ModalProps { } interface ComplaintModalProps extends ModalProps { product: string; - customerID: string; + user: string; } // const token = getAuthTokenFromCookies('UTM_tracker'); -const apiUrl = `https://zuri-cart-checkout.onrender.com/api/checkout_cart/complaints`; +const apiUrl = `https://team-mirage-super-amind2.onrender.com/api/v1/super-admin/feedback/register-complaints/`; -const ComplaintModal: React.FC = ({ isOpen, onClose, product, customerID }) => { +const ComplaintModal: React.FC = ({ isOpen, onClose, product, user }) => { const [description, setDescription] = useState(''); const [error, setError] = useState(null); - const data = { product_id: '136fda3b-6e1e-4711-a4ac-6dfb298615a9 ', complaint: description }; + const data = { user: user, product: product, complaint: description }; const stringifyData = JSON.stringify(data); //auth - const authToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImE3YjRiOThiLWFlMzMtNGQ0Yy1hNmUzLTQ4YzY5MGQ5NDUyMyIsImZpcnN0TmFtZSI6IkJvcmRlciIsImVtYWlsIjoibW9yemV5b21sZUBndWZ1bS5jb20iLCJpYXQiOjE2OTcyNzUwMDR9.2v-dtbXuYl5J97F_S2M-vZB8lVuAnwCM1x3FJ0xOJWs`; + // const authToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImE3YjRiOThiLWFlMzMtNGQ0Yy1hNmUzLTQ4YzY5MGQ5NDUyMyIsImZpcnN0TmFtZSI6IkJvcmRlciIsImVtYWlsIjoibW9yemV5b21sZUBndWZ1bS5jb20iLCJpYXQiOjE2OTcyNzUwMDR9.2v-dtbXuYl5J97F_S2M-vZB8lVuAnwCM1x3FJ0xOJWs`; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); @@ -48,7 +48,7 @@ const ComplaintModal: React.FC = ({ isOpen, onClose, produc method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: `Bearer ${authToken}`, + // Authorization: `Bearer ${authToken}`, }, body: stringifyData, }); diff --git a/pages/user/customer-purchase-dashboard/index.tsx b/pages/user/customer-purchase-dashboard/index.tsx index 86b6d07ce..a61f504b1 100644 --- a/pages/user/customer-purchase-dashboard/index.tsx +++ b/pages/user/customer-purchase-dashboard/index.tsx @@ -387,7 +387,7 @@ const MyPage: React.FC = () => { isOpen={isModalOpen} onClose={closeModal} product={selectedOrder?.product_id || ''} - customerID={selectedOrder?.customer_id || ''} + user={selectedOrder?.customer_id || ''} /> {/* delete modal */}