1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/hooks/api/actions/useInstanceStatusApi/useInstanceStatusApi.ts

22 lines
529 B
TypeScript
Raw Normal View History

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;