Currently in the AddStory Component, we only send an author's name, the story title and story content when creating a new story link in firestore. We need to refactor this function to send some additional information.
Acceptance Criteria
all pieces of data that should be sent as fields to the story link being added to firestore:
*Author displayName (string)
*Author id (string)
*Story Title (string)
*Story Content (string)
*Created Timestamp (Date)
Tags (string) default: blank string
Parent storyId (string) default: blank string
(asterisks mark required fields)
Notes
the currentUser object is exposed and available from the useAuthContext.js file, while the db object is available via the firebase.js file. These two objects are already being used in the AddStory component, but it's good to get accustomed to these two files mentioned above so you know how and when to use them.
You can learn more about how to access user info in firebase's auth docs here
You can learn about how to send a timestamp with firebase here
Description
Currently in the AddStory Component, we only send an author's name, the story title and story content when creating a new story link in firestore. We need to refactor this function to send some additional information.
Acceptance Criteria
(asterisks mark required fields)
Notes
the
currentUser
object is exposed and available from theuseAuthContext.js
file, while thedb
object is available via thefirebase.js
file. These two objects are already being used in the AddStory component, but it's good to get accustomed to these two files mentioned above so you know how and when to use them.You can learn more about how to access user info in firebase's auth docs here You can learn about how to send a timestamp with firebase here
Linked Issues
Subtask of #15