2
0

Created first api-calls #1

This commit is contained in:
glax 2023-05-23 13:15:29 +02:00
parent 87d2357b41
commit 290819de09

View File

@ -1,8 +1,35 @@
const apiUri = "http://localhost:5177"; const apiUri = "http://localhost:5177";
function GetTasks(){ function GetAvailableControllers(){
var getTaskUri = apiUri + "/Tasks/GetList"; var uri = apiUri + "/GetAvailableControllers";
fetch(getTaskUri) const response = await fetch(uri, {
.then(response => response.json()) method: 'GET',
.catch(error => console.error('Unable to get items.', error)); headers: {
'Accept': 'application/json'
}
}).catch(error => console.error('Unable to get items.', error));
return await response.json();
}
function GetTasks(){
var uri = apiUri + "/Tasks/GetList";
const response = await fetch(uri, {
method: 'GET',
headers: {
'Accept': 'application/json'
}
}).catch(error => console.error('Unable to get items.', error));
return await response.json();
}
async function GetSettings(){
var uri = apiUri + "/Settings/Get";
const response = await fetch(uri, {
method: 'GET',
headers: {
'Accept': 'application/json'
}
}).catch(error => console.error('Unable to get items.', error));
return await response.json();
} }