As a user, if I am logged in, I should be able to delete a log from the logs page.
AC
WHEN the page loads a gallery of logs should appear.
THEN if the user is logged in, the user can click on the delete button.
THEN the log is deleted from the page and the database.
Dev Notes
When the delete button/link is clicked, an event listener is fired that accesses firebase so that the log is deleted from DOM and from firebase.
This delete event listener will call a function that:
1)Grabs the logs id.
2) Makes an axios call to firebase to remove the logs data. The axios call should be in
the logsData.js file:
const deleteLog = (logId) => axios.delete(${baseUrl}/logs/${logsId}.json);
3) Call the READ function that displays the logs initially to display the updated logs to the page.
User Story
As a user, if I am logged in, I should be able to delete a log from the logs page.
AC
WHEN the page loads a gallery of logs should appear. THEN if the user is logged in, the user can click on the delete button. THEN the log is deleted from the page and the database.
Dev Notes
const deleteLog = (logId) => axios.delete(${baseUrl}/logs/${logsId}.json);
3) Call the READ function that displays the logs initially to display the updated logs to the page.