Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

82
Vistas
Can't run UpdateDoc function when using Redux and FireBase

PersonalSlice.js

 export const updatePersonal = createAsyncThunk("personal/updatePersonal", async (id, {getState})=>{
    const personalDoc = doc(db, "Personal", id)
    await updateDoc(personalDoc, getState().personal.updatePersonal );
});

Main.js

 const updateName = useSelector((state) => state.personal.updatePersonal.name);

const handleUpdateNameChange = (e) => {
        dispatch(changeUpdatePersonalName(e.currentTarget.value))
    }

const handleUpdateSubmit = (e) => {
        e.preventDefault();
        dispatch(updatePersonal({updateName , updateSurname, updateBirthday, updateStartDate, updateDepartment, updatePhone, updateMail}))
    }



 <Form onSubmit={handleUpdateSubmit}>
                        <p className="text-center" style={{ color: "#39ace7" }}>İsim</p>
                        <Form.Control 
                        size = "sm"
                            type="text"
                            name="updatePersonal"
                            onChange={handleUpdateNameChange}
                            value={updateName}
                            required
                            autoFocus
                        />

I can't send the data I want to update in the form to FireBase. My fault is most likely in the parameters.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you are starting a new project and/or are not required to have your Firebase data loaded into redux, you might want to give reactfire a try before trying react-redux-firebase. In reference to the above function call ,if the profile object contains a key or a list of keys as parameters, you can populate those parameters with the matching value from another location on firebase.

Setting config like this:

  userProfile: 'users', // where profiles are stored in database
  profileParamsToPopulate: [
    'contacts:users'
  ]
}

Results in profile with populated contacts parameter:

  displayName: 'ABC',
  email: 'abc@xyz.com',
  contacts: [
    {
      email: 'efg@xyz.com',
      displayName: 'EFG'
    },
     {
      email: 'pqr@xyz.com',
      displayName: 'PQR
    }
  ]
}

Please check the link here to understand the parameters call usage and related questions Update Data in Firebase and Update function in Firebase for reference.Also check the helpful documentation for configuration for redux-firebase

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda