How to get a value from a database based on a value from the same row, but different column - pls help!!!!!!!!!!

I am assuming this is coming from the front end? What is the last successful line before the .catch( (error) => {.