fix: new backend url

This commit is contained in:
Ruidy 2021-07-14 16:50:41 +02:00
parent d14a380276
commit 1f326cb12d
3 changed files with 3 additions and 4 deletions

View file

@ -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);

View file

@ -35,7 +35,7 @@ const BillPage = ({ bill }: BillProps) => {
return (
<main>
<Typography.Title>Facture #VFNI{`${bill.number}`}</Typography.Title>
<Typography.Title>Facture #VFNI{`${bill.id}`.padStart(4,"0")}</Typography.Title>
<Space>
<Button type="primary" onClick={() => handleSendPDF(bill.id)} disabled={sent}>
{sent ? "The bill is on its way to your customer" : "Send Bill"}

View file

@ -15,7 +15,6 @@ export type BillForm = {
export interface Bill {
id: number;
phoneNumber: number;
number: number;
name: string;
price: number;
start: Date;