mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-19 08:42:08 +03:00
1643b54b7b
* feat: update translations * feat: add <DeleteOrUnsubscribeConfirmationModal /> * test(DeleteOrUnsubscribeConfirmationModal): update tests * feat: redirect to /brains-management on invalid brain id * refactor: move delete_brain_user to delete_brain_users * feat: add /POST '/brains/{brain_id}/subscribe' * feat: handle public brain unsubscription
30 lines
869 B
TypeScript
30 lines
869 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) =>
|
|
subscribeToBrain(brainId, axiosInstance),
|
|
unsubscribeFromBrain: async (brainId: UUID) =>
|
|
unsubscribeFromBrain(brainId, axiosInstance),
|
|
};
|
|
};
|