Skip to content

Conversation

@cheney103
Copy link

@cheney103 cheney103 commented Mar 9, 2021

PROJECT CONTRIBUTIONS ARE ALLOWED AND WELCOMED. Follow the guidelines as outlined below!

Using Firebase Firestore to add, delete and edit todo list data.

Description

First of all a new component was created called Todo. The update and delete functionality were added in the Todo
component. For the add functionality, a reference was made to the database collection root "todos" then the add function
was applied. Within the add fucntion the usestate var was called (title) and the field was given the name as "title".
SetTitle was called empty to as to set the field empty when adding new task.

To get the data from firebase firestore, onSnapshot and querySnapshot was referenced. Also Id was set within get data as to
get or set data from a particular field. UseEffect was also implemented to called get data when the page has started. For the
delete function title and id props were added, then the database referenced the root which reference the id which called the delete.

In the update function a new usestate was created then the update function was called selecting the title field and linking it to
the new usestate variable created.

Other features were the localStorage was removed and data displayed in list as a paragraph.

Related Issue / Asana Task

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants