Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
How to display the data of a specific document?

I need to display it on the page when adding a bank. Now, when adding a bank - nothing happens. Nothing happens after successfulPopUp() . Even const doc is not output to the console. How to get one bank by id that the user creates?

const sendBankData = async () => {
  try {
    const docRef = await addDoc(collection(db, "banks"), {
      bankName: bankName.value,
      interestRate: interestRate.value,
      maximumLoan: maximumLoan.value,
      minimumDownPayment: minimumDownPayment.value,
      loanTerm: loanTerm.value,
    });
    successfulPopUp();
    const doc = doc(db, "banks", docRef.id);
    console.log(doc);
    const docSnap = await getDoc(docRef);
    if (docSnap.exists()) {
      console.log("Document data:", docSnap.data());
    } else {
      console.log("No such document!");
    }
  } catch (e) {
    // errorPopUp();
  }
};

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!