Accepted answer

To get rid of the javascript.mapis not a function error in your react code you have to replace tbody in your react code in the following way to handle your empty restaurants array until its state gets updated from the HTTP response.

    restaurants.length > 0 && => (
    <tr key={restaurants.restaurants_id}>

Your another question related to not getting response from the backend for your postgre SQL query, you must console.log() your query and try running it on SQL interface to find the syntactical errors.

Related Query

More Query from same tag