feat: Add Delete Project functionality to History Modal
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user