import toast from "react-hot-toast";
import axiosInstance from "../../util/axiosInstance";
import { setPops } from "../reducers/PopReducer";

export const fetchPopsMethod = () => async (dispatch) => {
    try {
        const { data } = await axiosInstance.get("/pops");
        console.log(data);
        dispatch(setPops(data));
    } catch (error) {
        toast.error("Failed to fetch pops");
    }
};
