Skip to content

Commit

Permalink
fix: 트랜딩 데이터 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimeodml committed Mar 22, 2024
1 parent 8ff7ac7 commit 76b81d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/Search/hooks/useTrendings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ const useTrendingList = () => {
isLoading, isError, data,
} = useQuery({ queryKey: ['trending'], queryFn: fetchTrendings });
const trendings = data?.data.trendings;
const precessedTrendings = trendings?.map((trending) => {
if (trending.indexOf('?') === -1) {
return trending;
}
return trending.slice(0, trending.indexOf('?'));
});

return {
isLoading, isError, data: trendings,
isLoading, isError, data: precessedTrendings,
};
};

Expand Down

0 comments on commit 76b81d0

Please sign in to comment.