UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

20 lines 770 B
import { useCallback } from "react"; import useProject from "../projects/useProject"; import useAxiosPrivate from "../../config/useAxiosPrivate"; function useCheckMyMembership() { const { projectId } = useProject(); const axios = useAxiosPrivate(); const checkMyMembership = useCallback(async ({ spaceId }) => { if (!projectId) { throw new Error("No projectId available."); } if (!spaceId) { throw new Error("Please pass a spaceId"); } const response = await axios.get(`/${projectId}/spaces/${spaceId}/membership/me`); return response.data; }, [projectId, axios]); return checkMyMembership; } export default useCheckMyMembership; //# sourceMappingURL=useCheckMyMembership.js.map