migrate genre type

This commit is contained in:
Aria Moradi
2021-09-05 01:11:25 +04:30
parent ba26d852dc
commit e4853864ec
7 changed files with 29 additions and 7 deletions

View File

@@ -49,7 +49,7 @@ export default function Anime() {
const { id } = useParams<{ id: string }>();
const [manga, setManga] = useState<IManga>();
const [manga, setManga] = useState<IAnime>();
const [episodes, setEpisodes] = useState<IEpisode[]>([]);
const [fetchedEpisodes, setFetchedEpisodes] = useState(false);
const [noEpisodesFound, setNoEpisodesFound] = useState(false);
@@ -63,7 +63,7 @@ export default function Anime() {
if (manga === undefined || !manga.freshData) {
client.get(`/api/v1/anime/anime/${id}/?onlineFetch=${manga !== undefined}`)
.then((response) => response.data)
.then((data: IManga) => {
.then((data: IAnime) => {
setManga(data);
setTitle(data.title);
});

View File

@@ -63,7 +63,7 @@ export default function AnimeSearchSingle() {
if (searchTerm.length > 0) {
client.get(`/api/v1/anime/source/${sourceId}/search/${searchTerm}/${lastPageNum}`)
.then((response) => response.data)
.then((data: { mangaList: IManga[], hasNextPage: boolean }) => {
.then((data: { mangaList: IAnime[], hasNextPage: boolean }) => {
setMessage('');
if (data.mangaList.length > 0) {
setMangas([

View File

@@ -45,7 +45,7 @@ export default function Player() {
setTitle('Reader');
client.get(`/api/v1/anime/anime/${animeId}/`)
.then((response) => response.data)
.then((data: IManga) => {
.then((data: IAnime) => {
setTitle(data.title);
});
}, [episodeIndex]);

View File

@@ -30,7 +30,7 @@ export default function SourceAnimes(props: { popular: boolean }) {
const sourceType = props.popular ? 'popular' : 'latest';
client.get(`/api/v1/anime/source/${sourceId}/${sourceType}/${lastPageNum}`)
.then((response) => response.data)
.then((data: { mangaList: IManga[], hasNextPage: boolean }) => {
.then((data: { mangaList: IAnime[], hasNextPage: boolean }) => {
setMangas([
...mangas,
...data.mangaList.map((it) => ({