From 82b71cd5497700f81e8ded7293134d83f5632ddb Mon Sep 17 00:00:00 2001 From: Sam Bao Date: Mon, 5 Feb 2024 19:35:45 -0700 Subject: [PATCH] added response when no upcoming concerts found --- src/BaseInput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BaseInput.js b/src/BaseInput.js index 506ecb5..450684d 100644 --- a/src/BaseInput.js +++ b/src/BaseInput.js @@ -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"); } @@ -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) => {