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

199
Visualizações
Error: firebase.firestore().collection().doc(*) 'documentPath' must point to a document in React Native

When I am trying to update my document in firebase I got an error like my topic. After I upload my image to firebase storage and I need to update the download link to my Users collection.(I used Redux-Saga for this process)

export function* uploadProfile(action) {
    console.log(action);
    const filePath = action.data.filePath;
    const fileName = action.data.fileName;
    const userID = action.data.userID;
    try {
        const uploadProfile = yield call(uploadFileFireBase, filePath, fileName)
        if (uploadProfile) {
            try {
                const updateProfile = yield call(updateUserFirebase, userID, uploadProfile)
               
                if (updateProfile) {

                }
            } catch (error) {
                console.log(error)
            }
        }
    } catch (error) {
        console.log(error)
    }
}


async function uploadFileFireBase(filePath, fileName) {
    const reference = storage().ref(fileName);
    await reference.putFile(filePath.toString());
    // console.log("Download URL:" + url)
    return await storage().ref(fileName).getDownloadURL();
}


/*
Update User Data
*/

function updateUserFirebase(uploadProfile, userID) {
    return firestore()
        .collection('Users')
        .doc(userID)
        .update({
            profileImage: uploadProfile,
        })
        .then((data) => {
            console.log('User updated!');
            return data;
        });
}

I spent hours and hours trying to make this write and I couldn't. So I really really need your help with this university project. Thank you very much for your time.❤️❤️

about 4 years ago · Juan Pablo Isaza
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