This commit is contained in:
2025-06-09 00:34:59 +09:00
parent 95165d2878
commit ac879b243d
2 changed files with 6 additions and 10 deletions

View File

@ -17,6 +17,8 @@ interface EpisodeWithFeedInfo {
feedId: string;
feedTitle?: string;
feedUrl: string;
category?: string;
feedCategory?: string;
}
function EpisodeDetail() {

View File

@ -164,20 +164,14 @@ function EpisodeList() {
}
};
const filterEpisodesByCategory = async () => {
const filterFeedsByCategory = () => {
if (!selectedCategory) {
setFilteredEpisodes(episodes);
} else {
const response = await fetch(
`/api/episodes/by-category?category=${selectedCategory}`,
const filtered = episodes.filter(
(ep) => ep.category === selectedCategory,
);
if (!response.ok) {
setError("カテゴリの取得に失敗しました");
return;
}
const episodes = await response.json();
setFilteredEpisodes(episodes);
setFilteredEpisodes(filtered);
}
};