UNPKG

@replyke/core

Version:

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

19 lines 758 B
import { useCallback } from "react"; import useProject from "../../projects/useProject"; import axios from "../../../config/axios"; function useFetchFollowersCountByUserId() { const { projectId } = useProject(); const fetchFollowersCountByUserId = useCallback(async ({ userId }) => { if (!userId) { throw new Error("No userId provided."); } if (!projectId) { throw new Error("No projectId available."); } const response = await axios.get(`/${projectId}/users/${userId}/followers-count`); return response.data; }, [projectId]); return fetchFollowersCountByUserId; } export default useFetchFollowersCountByUserId; //# sourceMappingURL=useFetchFollowersCountByUserId.js.map