I can’t send the variable from AJAX(js) to Python Flask
I have been working for this project over a month, and now I can’t fix the issue where it is not possible to correctly retrieve or send the variable ‘barber_id’ to Flask app. Overall, the JS code was generated by ChatGPT(because I’m new to JS). My main purpose is to get suggestions for barbershop name, barber name, haircut name(which each barber can perform differently) from Postgresql database WHILE I am typing in input fields dynamically. First of all, I have great struggles with sending a ‘barbershop_id’ to Flask app, but then I **fixed **it by choosing a barbershop-name from suggestions and retrieve its corresponding values from database. But now it is absolutely not possible to handle the ‘barber_id’ correctly, I have used almost all types of AI to help, but they didn’t useful at all.
Here is part of code which is problematic: