fix: people details page not working for people that are not in db
This commit is contained in:
1 parent
0329808562
commit
8aca121b10
5 files changed
+317
-20
No files matched your search
@@ -21,6 +21,20 @@ export interface TmdbFilmographyResponse {
|
||||
crew: TmdbFilmographyItem[];
|
||||
}
|
||||
|
||||
export interface TmdbPersonPreview {
|
||||
tmdb_id: number;
|
||||
name: string;
|
||||
biography: string | null;
|
||||
birthday: string | null;
|
||||
deathday: string | null;
|
||||
place_of_birth: string | null;
|
||||
profile_path: string | null;
|
||||
known_for_department: string | null;
|
||||
popularity: number | null;
|
||||
imdb_id: string | null;
|
||||
filmography: TmdbFilmographyResponse;
|
||||
}
|
||||
|
||||
export const peopleApi = {
|
||||
getAll: () => api.get<People[]>('/people').then((r) => r.data),
|
||||
|
||||
@@ -33,6 +47,9 @@ export const peopleApi = {
|
||||
getTmdbFilmography: (id: number) =>
|
||||
api.get<TmdbFilmographyResponse>(`/people/${id}/tmdb-filmography`).then((r) => r.data),
|
||||
|
||||
previewTmdb: (tmdbId: number) =>
|
||||
api.get<TmdbPersonPreview>(`/people/tmdb/preview/${tmdbId}`).then((r) => r.data),
|
||||
|
||||
fetchByTmdbId: (tmdb_id: number, pinned = false) =>
|
||||
api.post<People>('/people/fetch', { tmdb_id, pinned }).then((r) => r.data),
|
||||
|
||||
|
||||
Reference in new issue
Block a user