wheelshare-frontend/src/components/NewUI/api.ts
2021-07-01 13:06:33 -04:00

19 lines
400 B
TypeScript

export function post(path: string, data: any) {
return fetch('http://localhost:5000/api' + path, {
method: 'post',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
},
});
}
export function delete$(path: string, data: any) {
return fetch('http://localhost:5000/api' + path, {
method: 'delete',
headers: {
'Content-Type': 'application/json',
},
});
}