Skip to content

Commit e8ff2a1

Browse files
committed
update: address comments.
1 parent 0bad3d5 commit e8ff2a1

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
IconExternalLink,
2929
IconRefresh
3030
} from '@appwrite.io/pink-icons-svelte';
31+
import { addNotification } from '$lib/stores/notifications';
3132
3233
let limit = $state(5);
3334
let offset = $state(0);
@@ -44,13 +45,20 @@
4445
4546
async function loadInvoices() {
4647
isLoadingInvoices = true;
47-
invoiceList = await sdk.forConsole.billing.listInvoices(page.params.organization, [
48-
Query.orderDesc('$createdAt'),
49-
Query.limit(limit),
50-
Query.offset(offset)
51-
]);
52-
53-
isLoadingInvoices = false;
48+
try {
49+
invoiceList = await sdk.forConsole.billing.listInvoices(page.params.organization, [
50+
Query.orderDesc('$createdAt'),
51+
Query.limit(limit),
52+
Query.offset(offset)
53+
]);
54+
} catch (error) {
55+
addNotification({
56+
type: 'error',
57+
message: error.message
58+
});
59+
} finally {
60+
isLoadingInvoices = false;
61+
}
5462
}
5563
5664
function retryPayment(invoice: Invoice) {

0 commit comments

Comments
 (0)