complete noob here.
Trying to retrieve the firebase unique id from the first data push to use in the second so that I can reference the data between the two data sets. I used stackoverflow answers to retrieve the key, but my code didnt work.
(If you have a better way of referencing the two items other than utilizing firebase unique id, Im all for it!) thanks!!
export const GROUP_CREATE = 'group_create'; export const groupCreate = ({ name, course, members }) => { const { currentUser } = firebase.auth(); return (dispatch) => { var pushedRef = firebase.database().ref(`/groups`).push({ name }) var dataId = pushedRef.key .then( firebase.database().ref('/groups') .push({ name, dataId, course, members })) .then(() => { dispatch({ type: GROUP_CREATE }); Actions.groupMain({ type: 'reset' }); }); }; }; 