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

90
Views
Llamada eficiente de dos funciones PATCH en el envío

Llamo a dos funciones de un servicio en mi función de envío saveProfileContent() para guardar los datos modificados a través de PATCH. Esta operación también funciona. ¿Es posible hacer que las dos llamadas sean un poco más abstractas, eficientes y flexibles? ¿Tienes alguna idea? Tengo curiosidad por sus contribuciones e ideas.

Mi código:

 // TS ** * To save entries in the ProfileContent */ saveProfileContent() { this.submitted = true; // Stop here if form is invalid if (this.profileContentForm.invalid) { return { required: true }; } const values = this.profileContentForm.value; console.log('Show values', values); const successText = 'Ihre Daten wurden erfolgreich gespeichert!'; const errorText = 'Ihre Daten konnten nicht gespeichert werden!'; this.profileContentAlertType = null; this.profileContentMessage = null; this.userAreaService.changeUserEntries(`${values.userId}`, values).subscribe( currentUserData => { console.log('You change the currentUserData', currentUserData); this.submitted = false; if (currentUserData.success) { this.profileContentAlertType = 'success'; this.profileContentMessage = successText; } else { this.profileContentAlertType = 'error'; this.profileContentMessage = errorText; } }, error => { this.submitted = false; this.profileContentAlertType = 'error'; this.profileContentMessage = errorText; }); this.userAreaService.changeSetup(values).subscribe( currentMandantData => { console.log('You change the currentMandantData', currentMandantData); this.submitted = false; if (currentMandantData.success) { this.profileContentAlertType = 'success'; this.profileContentMessage = successText; } else { this.profileContentAlertType = 'error'; this.profileContentMessage = errorText; } }, error => { this.submitted = false; this.profileContentAlertType = 'error'; this.profileContentMessage = errorText; }); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

me parece bien. aunque dependiendo de las restricciones, parece que hay dominios superpuestos: lo más probable es que los datos en la entrada del usuario sean los mismos que los de la configuración.

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!