import { ref, set, get } from 'firebase/database';
import { realtimeDb } from '../__mocks__/firebase';

export const submitVote = (userId, voteValue) => {
  return set(ref(realtimeDb, `votes/${userId}`), voteValue);
};

export const fetchVotes = () => {
  const votesRef = ref(realtimeDb, 'votes/');
  return get(votesRef);
};
