feat(account): show next payment date with lazy Helcim refresh
Persist nextBillingDate on subscription create/update; unset on cancel or downgrade to free. Account page displays the cached date and lazily refreshes from Helcim when the cached value is within 24h of now (or missing).
This commit is contained in:
parent
4da0265935
commit
5d6fcdd78d
8 changed files with 146 additions and 3 deletions
|
|
@ -134,6 +134,9 @@ export const createHelcimSubscription = (subscription, idempotencyKey) =>
|
|||
errorMessage: 'Subscription creation failed'
|
||||
})
|
||||
|
||||
export const getHelcimSubscription = (id) =>
|
||||
helcimFetch(`/subscriptions/${id}`, { errorMessage: 'Subscription lookup failed' })
|
||||
|
||||
export const cancelHelcimSubscription = (id) =>
|
||||
helcimFetch(`/subscriptions/${id}`, { method: 'DELETE', errorMessage: 'Subscription cancellation failed' })
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue