chat client UI restructure + added all projects view and settings view(placeholder)

This commit is contained in:
Storme-bit
2026-04-13 17:08:52 -07:00
parent 7501fc54f1
commit 699592071f
10 changed files with 1077 additions and 27 deletions

View File

@@ -159,4 +159,35 @@ export async function deleteSession(sessionId) {
method: 'DELETE',
});
if (!res.ok) throw new Error(`Failed to delete session: ${res.status}`);
}
export async function fetchProjects() {
const res = await fetch(`${BASE_URL}/projects`);
if (!res.ok) throw new Error(`Failed to fetch projects: ${res.status}`);
return res.json();
}
export async function createProject({ name, description, colour, icon }) {
const res = await fetch(`${BASE_URL}/projects`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name, description, colour, icon }),
});
if (!res.ok) throw new Error(`Failed to create project: ${res.status}`);
return res.json();
}
export async function updateProject(id, { name, description, colour, icon }) {
const res = await fetch(`${BASE_URL}/projects/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name, description, colour, icon }),
});
if (!res.ok) throw new Error(`Failed to update project: ${res.status}`);
return res.json();
}
export async function deleteProject(id) {
const res = await fetch(`${BASE_URL}/projects/${id}`, { method: 'DELETE' });
if (!res.ok) throw new Error(`Failed to delete project: ${res.status}`);
}