mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
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;
|