23 lines
539 B
TypeScript
23 lines
539 B
TypeScript
const baseUrl = "https://webapp-deployer-api.apps.snowballtools.com";
|
|
|
|
export const fetchAllStatuses = async () => {
|
|
const res = await fetch(baseUrl);
|
|
if (!res.ok) {
|
|
throw new Error('Network response was not ok')
|
|
}
|
|
return await res.json();
|
|
}
|
|
|
|
|
|
export const fetchLogs = async (id: string) => {
|
|
if (!id) {
|
|
return "";
|
|
}
|
|
let url = `${baseUrl}/log/${id}`
|
|
const res = await fetch(url);
|
|
if (!res.ok) {
|
|
throw new Error('Network response was not ok')
|
|
}
|
|
return await res.text();
|
|
}
|