mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: getting subscription endpoint
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
// @ts-nocheck
|
||||
// @ts-ignore
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions,
|
||||
UseMutationResult,
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
UseQueryOptions,
|
||||
UseQueryResult,
|
||||
} from 'react-query';
|
||||
import useApiRequest from '../useRequest';
|
||||
|
||||
@@ -113,3 +116,29 @@ export function useChangeSubscriptionPlan(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
interface GetSubscriptionsQuery {}
|
||||
interface GetSubscriptionsResponse {}
|
||||
|
||||
/**
|
||||
* Changese the main subscription of the current organization.
|
||||
* @param {UseMutationOptions<ChangeMainSubscriptionPlanValues, Error, ChangeMainSubscriptionPlanResponse>} options -
|
||||
* @returns {UseMutationResult<ChangeMainSubscriptionPlanValues, Error, ChangeMainSubscriptionPlanResponse>}
|
||||
*/
|
||||
export function useGetSubscriptions(
|
||||
options?: UseQueryOptions<
|
||||
GetSubscriptionsQuery,
|
||||
Error,
|
||||
GetSubscriptionsResponse
|
||||
>,
|
||||
): UseQueryResult<GetSubscriptionsResponse, Error> {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useQuery<GetSubscriptionsQuery, Error, GetSubscriptionsResponse>(
|
||||
['SUBSCRIPTIONS'],
|
||||
(values) => apiRequest.get(`/subscription`).then((res) => res.data),
|
||||
{
|
||||
...options,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user