mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-14 13:19:05 +03:00
30 lines
912 B
TypeScript
30 lines
912 B
TypeScript
import { UUID } from "crypto";
|
|
|
|
import { useAxios } from "@/lib/hooks";
|
|
|
|
import {
|
|
acceptInvitation,
|
|
declineInvitation,
|
|
getInvitation,
|
|
subscribeToBrain,
|
|
unsubscribeFromBrain,
|
|
} from "./subscription";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useSubscriptionApi = () => {
|
|
const { axiosInstance } = useAxios();
|
|
|
|
return {
|
|
acceptInvitation: async (brainId: UUID) =>
|
|
acceptInvitation(brainId, axiosInstance),
|
|
declineInvitation: async (brainId: UUID) =>
|
|
declineInvitation(brainId, axiosInstance),
|
|
getInvitation: async (brainId: UUID) =>
|
|
getInvitation(brainId, axiosInstance),
|
|
subscribeToBrain: async (brainId: UUID, secrets?: Record<string, string>) =>
|
|
subscribeToBrain(brainId, axiosInstance, secrets),
|
|
unsubscribeFromBrain: async (brainId: UUID) =>
|
|
unsubscribeFromBrain(brainId, axiosInstance),
|
|
};
|
|
};
|