feat: add trending to discover page

This commit is contained in:
sct
2020-11-13 01:48:32 +00:00
parent 67290dd502
commit ff8b9d8e7e
4 changed files with 183 additions and 8 deletions

View File

@@ -556,15 +556,19 @@ class TheMovieDb {
public getAllTrending = async ({
page = 1,
timeWindow = 'day',
}: { page?: number; timeWindow?: 'day' | 'week' } = {}): Promise<
TmdbSearchMultiResponse
> => {
language = 'en-US',
}: {
page?: number;
timeWindow?: 'day' | 'week';
language?: string;
} = {}): Promise<TmdbSearchMultiResponse> => {
try {
const response = await this.axios.get<TmdbSearchMultiResponse>(
`/trending/all/${timeWindow}`,
{
params: {
page,
language,
},
}
);