Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
How to avoid duplicate scheduling of a trainer?

I have trainer Id, date, start_time, end_time. How can I avoid selecting the trainer for the pre occupied schedule??

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

First of all you should verify this scenario from your backend code, not in react.

Let's assume that you are using Node JS as a backend.

  1. First thing you need to do from your react js code is to select a trainer and a specific date. Once you have selected both the fields, you will have to make an API call.

  2. Now create one API in your backend, which verifies the whether the selected trainer is available for given date and time. So let's assume that your API name is checkTrainerAvailability.

  3. Now write the query, if it returns the result then show an error message in your react code. If the query returns nothing that means the trainer is available.

about 4 years ago · Juan Pablo Isaza Denunciar

0

First, we need to compare the trainer getting selected by the user and match its ID and the date with the database. if it matches then we need to take the incoming data and the date in the database as an array and divide it by 30 minutes of the time frame and store it in that variable of the database, then we need to compare both arrays and see for any duplicate records, if it has any duplicate records it means the trainer is already allotted somewhere.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda