Skip to content

Commit

Permalink
Merge pull request #2 from AJTKS/request
Browse files Browse the repository at this point in the history
Fix: result page
  • Loading branch information
jun-brro authored May 16, 2024
2 parents f0beabe + 55bb3cd commit d414833
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Pages/ResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ const ResultPage = () => {
const { status, searchResult } = response.data;

if (status === "completed") {
setSearchResult(searchResult);
// Decode the search result
const decodedResult = searchResult.map((result: any) => ({
...result,
musicName: decodeURIComponent(escape(result.musicName)),
singer: decodeURIComponent(escape(result.singer)),
}));
setSearchResult(decodedResult);
} else {
setTimeout(fetchResult, 3000);
}
Expand Down Expand Up @@ -83,6 +89,12 @@ const ResultPage = () => {
alt={`Music recommendation ${index + 1}`}
/>
</div>
<div className="p-2">
<div className="text-black text-sm font-bold">
{result.musicName}
</div>
<div className="text-gray-700 text-xs">{result.singer}</div>
</div>
</div>
))}
</div>
Expand Down

0 comments on commit d414833

Please sign in to comment.