diff --git a/api/index.ts b/api/index.ts index 91e5d56..90a3141 100644 --- a/api/index.ts +++ b/api/index.ts @@ -1,13 +1,13 @@ import axios from "axios"; import { Bill, BillForm } from "../types/bill"; -const BASE_URL = "http://localhost:8000/api/v1/"; +const BASE_URL = "http://localhost:9000/bills"; const client = axios.create({ baseURL: BASE_URL }); export const createBill = async (data: BillForm) => { try { - const { data: response } = await client.post("/", JSON.stringify(data)); + const { data: response } = await client.post("/", data) return response; } catch (error) { console.error(error); diff --git a/pages/bills/[id].tsx b/pages/bills/[id].tsx index cc66ecb..e20a6c8 100644 --- a/pages/bills/[id].tsx +++ b/pages/bills/[id].tsx @@ -35,7 +35,7 @@ const BillPage = ({ bill }: BillProps) => { return (
- Facture #VFNI{`${bill.number}`} + Facture #VFNI{`${bill.id}`.padStart(4,"0")}