This commit is contained in:
2026-03-29 19:30:14 +02:00
parent 4757cf47c0
commit eaa0c9b0e0
3 changed files with 19 additions and 4 deletions
+15
View File
@@ -1,3 +1,4 @@
//api.jsx
const API_BASE = '/api';
export async function fetchCards() {
@@ -27,4 +28,18 @@ export async function updateCardAmount(cardId, setId, rarityId, amount) {
if (!response.ok) throw new Error('Failed to update amount');
return await response.json();
}
export async function fetchDatabaseVersion() {
const response = await fetch(`${API_BASE}/db-version`);
if (!response.ok) throw new Error('Failed to fetch database version');
return await response.json();
}
export async function triggerFullImport() {
const response = await fetch(`${API_BASE}/import/full-import`, {
method: 'POST'
});
if (!response.ok) throw new Error('Failed to trigger full import');
return await response.json();
}