feat: Add initial frontend dependencies, base CSS, and Gitea Docker build workflow.
Some checks failed
Build and Push Docker Images / build-and-push (push) Failing after 2m23s

This commit is contained in:
almazlar
2026-02-20 23:12:41 +03:00
parent c8572c5456
commit cf58ccb2c8
34 changed files with 4424 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
const BASE_URL = 'http://localhost:8082/api/todos';
export const getTodos = async () => {
const response = await fetch(BASE_URL);
if (!response.ok) throw new Error('Failed to fetch todos');
return response.json();
};
export const createTodo = async (todo) => {
const response = await fetch(BASE_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(todo),
});
if (!response.ok) throw new Error('Failed to create todo');
return response.json();
};
export const updateTodo = async (id, todo) => {
const response = await fetch(`${BASE_URL}/${id}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(todo),
});
if (!response.ok) throw new Error('Failed to update todo');
return response.json();
};
export const deleteTodo = async (id) => {
const response = await fetch(`${BASE_URL}/${id}`, {
method: 'DELETE',
});
if (!response.ok) throw new Error('Failed to delete todo');
return true;
};