mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
7093b49962
* feat: add billing page to admin * some adjustments to billing page * add BillingHistory, remove invoices, misc improvements * refactor based on instanceStatus logic, add dialog * fix: cleanup * some refactoring and alignment with figma * add extend, isBilling, refactoring and misc improvements * fix: update tests * refactor: reorganize billing into smaller components, misc improvements * add STRIPE flag, some refactoring and adapting to comments and discussion * adapt BillingHistory slightly, refactor TextCell * Update src/hooks/api/getters/useInstanceStatus/useInstanceStatus.ts Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> * refactor: address PR comments * fix: adjust divider color * fix: update snaps * refactor: address PR comments * fix: update snaps * fix: amountFormatted typo Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
22 lines
529 B
TypeScript
22 lines
529 B
TypeScript
import useAPI from '../useApi/useApi';
|
|
|
|
const useInstanceStatusApi = () => {
|
|
const { makeRequest, createRequest, errors, loading } = useAPI({
|
|
propagateErrors: true,
|
|
});
|
|
|
|
const extendTrial = async (): Promise<void> => {
|
|
const path = 'api/instance/extend';
|
|
const req = createRequest(path, { method: 'POST' }, 'extendTrial');
|
|
await makeRequest(req.caller, req.id);
|
|
};
|
|
|
|
return {
|
|
extendTrial,
|
|
loading,
|
|
errors,
|
|
};
|
|
};
|
|
|
|
export default useInstanceStatusApi;
|