Fix avatar wallet balance by serving JSON from /wallet/balance.
Deploy Ladill Care / deploy (push) Successful in 28s
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user