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

147
Views
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 answers
Answer question

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 Report

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 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!