Created first api-calls #1
This commit is contained in:
parent
87d2357b41
commit
290819de09
@ -1,8 +1,35 @@
|
||||
const apiUri = "http://localhost:5177";
|
||||
|
||||
function GetAvailableControllers(){
|
||||
var uri = apiUri + "/GetAvailableControllers";
|
||||
const response = await fetch(uri, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
}).catch(error => console.error('Unable to get items.', error));
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
|
||||
function GetTasks(){
|
||||
var getTaskUri = apiUri + "/Tasks/GetList";
|
||||
fetch(getTaskUri)
|
||||
.then(response => response.json())
|
||||
.catch(error => console.error('Unable to get items.', error));
|
||||
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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user