src/views/InformationPage/LocationRating.js
//saves The Rating applied to the Stars
saves The Rating applied to the Stars
saves The Rating applied to the Stars
async saveRating() {
        try {
            const url = '/locations/rating/' + localStorage.getItem('userId') + '/' + this.props.locationId + "/" + this.state.ratedStars;
            await api.put(url);
            this.showUserRating();
            this.showAverageRating();
        } catch (e) {
            alert(`Something went wrong while updating the rating: \n${handleError(e)}`);
        }
    }
async saveRating ( ) { try { const url = '/locations/rating/' + localStorage . getItem ( 'userId' ) + '/' + this . props . locationId + "/" + this . state . ratedStars ; await api . put ( url ) ; this . showUserRating ( ) ; this . showAverageRating ( ) ; } catch ( e ) { alert ( ` \n ${ handleError ( e ) } ` ) ; } }
saves The Rating applied to the Stars
saves The Rating applied to the Stars