Skip to content

Commit

Permalink
added response when no upcoming concerts found
Browse files Browse the repository at this point in the history
  • Loading branch information
sam9116 committed Feb 6, 2024
1 parent fa070eb commit 82b71cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/BaseInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ const BaseInput = forwardRef(({ setConcerts, setUserLocation, setMapStyle, start
if (res.status === 200) {

if (resJson.length < 1) {
alert(`no upcoming concerts for ${incomingArtistName} found`);
return;
}
console.log(`resJson: ${resJson.length}`);
console.log(`add incoming concerts into allconcerts`);
console.log(`total Number Of Concerts Memorized: ${allConcerts.length}`);
setAllConcerts((prev) => prev.concat(resJson), sortArtist(allConcerts.concat(resJson), userLocation));

} else {
console.log("Some error occured");
}
Expand All @@ -88,7 +90,7 @@ const BaseInput = forwardRef(({ setConcerts, setUserLocation, setMapStyle, start

let handleSubmit = async (e) => {
e.preventDefault();
setConcerts([], submitArtist(artistName));
submitArtist(artistName);
};

const sortArtist = (incomingAllConcerts, userLocation) => {
Expand Down

0 comments on commit 82b71cd

Please sign in to comment.