This commit is contained in:
Andrew Trieu
2023-06-24 15:46:26 +03:00
parent 417e182d52
commit 65c796a49b

View File

@@ -18,7 +18,6 @@ const createNew = async (content) => {
const addVote = async (id) => {
const anecdotes = await getAll();
const anecdote = anecdotes.find((a) => a.id === id);
console.log(anecdote);
const voted = { ...anecdote, votes: anecdote.votes + 1 };
const response = await axios.put(`${baseUrl}/${id}`, voted);
return response.data;