feat: Implement data import and export functionality for notes and tags.

This commit is contained in:
2025-12-23 02:27:26 +01:00
parent 2ee9de866a
commit e4f021a68f
6 changed files with 200 additions and 8 deletions

View File

@@ -73,4 +73,12 @@ export const api = {
body: JSON.stringify(body),
}),
delete: (endpoint: string) => fetchWithAuth(endpoint, { method: "DELETE" }),
exportData: async () => {
const response = await fetch(`${getApiUrl()}/export`, {
credentials: "include",
});
if (!response.ok) throw new ApiError(response.status, "Failed to export data");
return response.blob();
},
importData: (data: any) => api.post("/import", data),
};