initial upload
This commit is contained in:
parent
ac114da487
commit
7c1cfdff51
63 changed files with 6883 additions and 0 deletions
45
assets/api.js
Normal file
45
assets/api.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
const LabelApi = {
|
||||
async GET(Endpoint)
|
||||
{
|
||||
const Response = await fetch(`/api/${Endpoint}`, {
|
||||
method: "GET"
|
||||
});
|
||||
|
||||
return Response.json();
|
||||
},
|
||||
async POST(Endpoint, BodyData = {})
|
||||
{
|
||||
const Response = await fetch(`/api/${Endpoint}`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(BodyData)
|
||||
});
|
||||
|
||||
return Response.json();
|
||||
},
|
||||
async PUT(Endpoint, BodyData = {})
|
||||
{
|
||||
const Response = await fetch(`/api/${Endpoint}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(BodyData)
|
||||
});
|
||||
|
||||
return Response.json();
|
||||
},
|
||||
async DELETE(Endpoint, BodyData = {})
|
||||
{
|
||||
const Response = await fetch(`/api/${Endpoint}`, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(BodyData)
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue