Per our discussion during office hours on 7/29, we could refactor this code slightly so that instead of adding the token as a standalone string to the database, we could add it as an object to the database with a token property. Something like this:
const tokenTemplate = { token: token }
Note: Please ask questions if this doesn't make sense! Not sure this is clear 😅
In our Home component, we are adding new tokens to the database like so:
const createToken = async () => { const token = getToken(); localStorage.setItem('token', token); await firestore.collection('tokens').doc(token).set({}); history.push('/list'); };
Per our discussion during office hours on 7/29, we could refactor this code slightly so that instead of adding the token as a standalone string to the database, we could add it as an object to the database with a token property. Something like this:
const tokenTemplate = { token: token }
Note: Please ask questions if this doesn't make sense! Not sure this is clear 😅