This commit is contained in:
Ruidy 2022-09-10 13:02:18 +02:00
parent 7ee04ddef0
commit 735354da72
9 changed files with 31 additions and 38 deletions

1
.gitignore vendored
View file

@ -19,3 +19,4 @@ yarn-error.log*
.vscode/ .vscode/
.idea/ .idea/
*.pem

View file

@ -1,20 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8"/>
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000"/>
<meta <meta name="description" content="Web site created using create-react-app"/>
name="description" <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/>
content="Web site created using create-react-app" <link rel="manifest" href="%PUBLIC_URL%/manifest.json"/>
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Melon | Property Management</title> <title>Melon | Property Management</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
</body> </body>
</html> </html>

View file

@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react"; import { render, screen } from '@testing-library/react';
import App from "./App"; import App from './App';
test("renders learn react link", () => { test('renders learn react link', () => {
render(<App />); render(<App />);
const linkElement = screen.getByText(/learn react/i); const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument(); expect(linkElement).toBeInTheDocument();

View file

@ -1,4 +1,4 @@
import Router from "./Router"; import Router from './Router';
export default function App() { export default function App() {
return <Router />; return <Router />;

View file

@ -12,6 +12,7 @@ export const createBill = async (data: BillFormType) => {
return 0; return 0;
} }
}; };
export const updateBill = async (id: number, data: BillFormType): Promise<Response<void>> => { export const updateBill = async (id: number, data: BillFormType): Promise<Response<void>> => {
try { try {
const { data: response } = await client.put<void>(`${billsURL}/${id}`, data); const { data: response } = await client.put<void>(`${billsURL}/${id}`, data);
@ -21,6 +22,7 @@ export const updateBill = async (id: number, data: BillFormType): Promise<Respon
return { error }; return { error };
} }
}; };
export const fetchOneBill = async (id: number): Promise<Response<Bill>> => { export const fetchOneBill = async (id: number): Promise<Response<Bill>> => {
try { try {
const { data } = await client.get<Bill>(`${billsURL}/${id}`); const { data } = await client.get<Bill>(`${billsURL}/${id}`);
@ -30,6 +32,7 @@ export const fetchOneBill = async (id: number): Promise<Response<Bill>> => {
return { error }; return { error };
} }
}; };
export const fetchAllBills = async () => { export const fetchAllBills = async () => {
try { try {
const { data } = await client.get<Bill[]>(billsURL); const { data } = await client.get<Bill[]>(billsURL);

View file

@ -1,5 +1,5 @@
import { Form, Select } from "antd"; import { Form, Select } from 'antd';
import { Controller } from "react-hook-form"; import { Controller } from 'react-hook-form';
type InputSelectProps = { type InputSelectProps = {
control: any; control: any;
@ -24,7 +24,7 @@ export const InputSelect = ({ control, name, label, placeholder, options }: Inpu
} }
options={options.map((label, value) => ({ options={options.map((label, value) => ({
value, value,
label, label
}))} }))}
{...field} {...field}
/> />

View file

@ -1 +1 @@
@import "antd/dist/antd.css"; @import 'antd/dist/antd.css';

View file

@ -1,8 +1,8 @@
import { ReportHandler } from "web-vitals"; import { ReportHandler } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: ReportHandler) => { const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry) { if (onPerfEntry) {
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry); getCLS(onPerfEntry);
getFID(onPerfEntry); getFID(onPerfEntry);
getFCP(onPerfEntry); getFCP(onPerfEntry);

View file

@ -1,11 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
@ -23,10 +19,6 @@
"noEmit": true, "noEmit": true,
"jsx": "react-jsx" "jsx": "react-jsx"
}, },
"include": [ "include": ["src"],
"src" "exclude": ["node_modules"]
],
"exclude": [
"node_modules"
]
} }