menu

React Native

A place to talk all about React Native!

Channels
Team

Need help to fix this: Can't push data to the firebase database

February 5, 2019 at 8:06am

Need help to fix this: Can't push data to the firebase database

February 5, 2019 at 8:06am (Edited 2 months ago)

Firebase Database Rule

{

"rules": {

"users": {

"$uid": {

".read": "$uid === auth.uid",

".write": "$uid === auth.uid"

}

}

}

}

redux/uiActions.js(Action file)

export const employeeUpdate = ({ prop, value }) => ({

type: 'employee_update',

payload: { prop, value }

});

export const employeeCreate = ({ name, phone, shift }) => {

const { currentUser } = firebase.auth();

return () => {

firebase.database().ref(`/users/${currentUser.uid}/seats`)

.push({ name, phone, shift })

};

};

I can get the value in console but data is not saved in firebase.

No messages yet