I have a function and i am trying to add the id parameter to the url and dynamically change the url and add the id parameter to it. but using curly braces doesnt reflect the parameter.
submitRating(rate, id) {
this.setState({
rating: rate,
});
console.log(this.state.rating);
console.log(id); ------> the console calls the id eg. id = 3499583
const url = "https://oversight-ws.herokuapp.com/api/politicians/{id}/rating" ---> that id should be rendered here on {id}
console.log(url); ---> i want to return this url https://oversight-ws.herokuapp.com/api/politicians/3499583/rating
return;