feat: Market Intel Database & UI Polish
- market_db_manager.py: Created SQLite manager for saving/loading projects. - server.cjs: Added API routes for project management. - geminiService.ts: Added client-side DB functions. - StepInput.tsx: Added 'Past Runs' sidebar to load previous audits. - App.tsx: Added auto-save functionality and full state hydration logic. - StepOutreach.tsx: Improved UI layout by merging generated campaigns and suggestions into one list.
This commit is contained in:
@@ -251,4 +251,28 @@ export const translateEmailDrafts = async (drafts: EmailDraft[], targetLanguage:
|
||||
// Dieser Teil muss noch im Python-Backend oder direkt im Frontend implementiert werden
|
||||
console.warn("translateEmailDrafts ist noch nicht im Python-Backend implementiert.");
|
||||
return drafts;
|
||||
}
|
||||
}
|
||||
|
||||
// --- PROJECT MANAGEMENT (DB) ---
|
||||
|
||||
export const listProjects = async (): Promise<any[]> => {
|
||||
const response = await fetch(`${API_BASE_URL}/projects`);
|
||||
if (!response.ok) throw new Error("Failed to list projects");
|
||||
return await response.json();
|
||||
};
|
||||
|
||||
export const loadProject = async (id: string): Promise<any> => {
|
||||
const response = await fetch(`${API_BASE_URL}/projects/${id}`);
|
||||
if (!response.ok) throw new Error("Failed to load project");
|
||||
return await response.json();
|
||||
};
|
||||
|
||||
export const saveProject = async (data: any): Promise<any> => {
|
||||
const response = await fetch(`${API_BASE_URL}/save-project`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
if (!response.ok) throw new Error("Failed to save project");
|
||||
return await response.json();
|
||||
};
|
||||
Reference in New Issue
Block a user