mirror of
https://github.com/rjNemo/melon_frontend
synced 2026-06-06 02:16:45 +00:00
fix: new backend url
This commit is contained in:
parent
d14a380276
commit
1f326cb12d
3 changed files with 3 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ export type BillForm = {
|
|||
export interface Bill {
|
||||
id: number;
|
||||
phoneNumber: number;
|
||||
number: number;
|
||||
name: string;
|
||||
price: number;
|
||||
start: Date;
|
||||
|
|
|
|||
Loading…
Reference in a new issue