diff --git a/admin/index.php b/admin/index.php index f79d34a..5eaf697 100644 --- a/admin/index.php +++ b/admin/index.php @@ -3232,7 +3232,7 @@ async function saveCreditEntry() { const payload = entryId ? {id:parseInt(entryId),credits_purchased:credits,credit_date:date,payment_method:method,notes} : {platform_id:_creditPlatformId,credits_purchased:credits,credit_date:date,payment_method:method,notes}; - const d = await apiFetch(action,'POST',payload); + const d = await fetch(`/api/platforms.php?action=${action}`,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(payload)}).then(r=>r.json()); if (d.success) { showAdminAlert(al, entryId ? 'Entry updated!' : 'Entry added!', 'success'); resetCreditForm(); @@ -3244,7 +3244,7 @@ async function saveCreditEntry() { async function deleteCreditEntry(id) { if (!confirm('Delete this credit entry? This cannot be undone.')) return; - const d = await apiFetch('credits_delete','POST',{id}); + const d = await fetch('/api/platforms.php?action=credits_delete',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({id})}).then(r=>r.json()); if (d.success) { toast('Entry deleted','ok'); await loadCreditEntries(); } else toast(d.error||'Error','err'); }