feat: Add Delete Project functionality to History Modal

This commit is contained in:
2025-12-29 15:28:04 +00:00
parent 1b1a779ae0
commit 6c1ec1dfe8
4 changed files with 133 additions and 22 deletions

View File

@@ -267,6 +267,14 @@ export const loadProject = async (id: string): Promise<any> => {
return await response.json();
};
export const deleteProject = async (id: string): Promise<any> => {
const response = await fetch(`${API_BASE_URL}/projects/${id}`, {
method: 'DELETE'
});
if (!response.ok) throw new Error("Failed to delete project");
return await response.json();
};
export const saveProject = async (data: any): Promise<any> => {
const response = await fetch(`${API_BASE_URL}/save-project`, {
method: 'POST',