Clean up
This commit is contained in:
@@ -18,7 +18,6 @@ const createNew = async (content) => {
|
|||||||
const addVote = async (id) => {
|
const addVote = async (id) => {
|
||||||
const anecdotes = await getAll();
|
const anecdotes = await getAll();
|
||||||
const anecdote = anecdotes.find((a) => a.id === id);
|
const anecdote = anecdotes.find((a) => a.id === id);
|
||||||
console.log(anecdote);
|
|
||||||
const voted = { ...anecdote, votes: anecdote.votes + 1 };
|
const voted = { ...anecdote, votes: anecdote.votes + 1 };
|
||||||
const response = await axios.put(`${baseUrl}/${id}`, voted);
|
const response = await axios.put(`${baseUrl}/${id}`, voted);
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user