mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-22 10:51:46 +03:00
2c9a0c1ed2
* feat: add public brain details modal * feat(brain): add subscription route * feat: activate subscription button * feat: add last_update column to brain table * feat: display last update on public brain details page * feat: change RBAC rule for public brains * feat: maintain brain last_update time
27 lines
742 B
TypeScript
27 lines
742 B
TypeScript
import { UUID } from "crypto";
|
|
|
|
import { useAxios } from "@/lib/hooks";
|
|
|
|
import {
|
|
acceptInvitation,
|
|
declineInvitation,
|
|
getInvitation,
|
|
subscribeToBrain,
|
|
} 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),
|
|
};
|
|
};
|