Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

88
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda