Fix avatar wallet balance by serving JSON from /wallet/balance.
Deploy Ladill Care / deploy (push) Successful in 28s

The dropdown was fetching care.wallet (account redirect HTML) instead of a
billing balance API, so Alpine always fell back to "View wallet".

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 18:13:13 +00:00
co-authored by Cursor
parent 2cff8fdd6c
commit 61b901095f
5 changed files with 127 additions and 1 deletions
+5
View File
@@ -129,6 +129,11 @@ Alpine.data('afia', (config = {}) => ({
Alpine.data('walletWidget', (config = {}) => ({
display: '…',
async load() {
if (! config.url) {
this.display = 'View wallet';
return;
}
try {
const res = await fetch(config.url, { headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' } });
const data = await res.json();