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

173
Views
¿Cómo puedo devolver datos como mensaje de éxito cuando configuro datos en firebase?

Intento devolver el ID de pedido después de configurar este pedido en la base de datos en tiempo real usando angularfirestore, lo que debo usar después de set() para devolver el ID de pedido después de agregar este pedido a la base de datos

mi objeto de pedido es este:

 const orderObj: Order = { payMethod: paymethod, arrivalHour: arrivalHour, tabel: this.tabel, itemsCount: Object.keys(this.handleCart.getCartData().items).length, state: { cook: false, serve: false, delete: false }, items: this.handleCart.getCartData().items, orderId: new Date().toLocaleDateString(), addedOnDate: new Date().toLocaleDateString(), addedOnHour: new Date().toLocaleTimeString('en-US'), totalPrice: this.handleCart.getCartData().totalAmt, };

y para configurar los datos en la base de datos, uso angular fire store como eso:

 constructor(private store: AngularFirestore, private router: Router) { store.collection('Orders').doc(this.data.Id).set(this.data) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede envolver la operación db con una captura de prueba y manejar en consecuencia.

 try { store.collection('Orders').doc(this.data.Id).set(this.data) return { docId: this.data.id } } catch (error) { return { error, errorMessage: 'something went wrong' } }
about 4 years ago · Juan Pablo Isaza Report
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!