format & combined equal changes type
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import { BaseEndpoint } from './base';
|
||||
import { ChangeOptions, Changes } from '../types/changes';
|
||||
import { ChangeOptions, MediaChanges } from '../types/changes';
|
||||
|
||||
export class ChangeEndpoint extends BaseEndpoint {
|
||||
constructor(protected readonly accessToken: string) {
|
||||
super(accessToken);
|
||||
}
|
||||
|
||||
async movies(options?: ChangeOptions): Promise<Changes> {
|
||||
return await this.api.get<Changes>(`/movie/changes`, options);
|
||||
async movies(options?: ChangeOptions): Promise<MediaChanges> {
|
||||
return await this.api.get<MediaChanges>(`/movie/changes`, options);
|
||||
}
|
||||
|
||||
async tvShows(options?: ChangeOptions): Promise<Changes> {
|
||||
return await this.api.get<Changes>(`/tv/changes`, options);
|
||||
async tvShows(options?: ChangeOptions): Promise<MediaChanges> {
|
||||
return await this.api.get<MediaChanges>(`/tv/changes`, options);
|
||||
}
|
||||
|
||||
async person(options?: ChangeOptions): Promise<Changes> {
|
||||
return await this.api.get<Changes>(`/person/change`, options);
|
||||
async person(options?: ChangeOptions): Promise<MediaChanges> {
|
||||
return await this.api.get<MediaChanges>(`/person/change`, options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ import {
|
||||
AppendToResponse,
|
||||
AppendToResponseKeys,
|
||||
ChangeOptions,
|
||||
Changes,
|
||||
Credits,
|
||||
ExternalIds,
|
||||
Images,
|
||||
Keywords,
|
||||
LanguageOption,
|
||||
LatestMovie,
|
||||
MovieChanges,
|
||||
MovieDetails,
|
||||
MovieLists,
|
||||
MoviesPlayingNow,
|
||||
@@ -40,7 +40,9 @@ export class MoviesEndpoint extends BaseEndpoint {
|
||||
appendToResponse?: T
|
||||
) {
|
||||
const options = {
|
||||
append_to_response: appendToResponse ? appendToResponse.join(',') : undefined,
|
||||
append_to_response: appendToResponse
|
||||
? appendToResponse.join(',')
|
||||
: undefined,
|
||||
};
|
||||
|
||||
return await this.api.get<AppendToResponse<MovieDetails, T>>(
|
||||
@@ -55,11 +57,8 @@ export class MoviesEndpoint extends BaseEndpoint {
|
||||
);
|
||||
}
|
||||
|
||||
async changes(id: number, options?: ChangeOptions): Promise<MovieChanges> {
|
||||
return await this.api.get<MovieChanges>(
|
||||
`${BASE_MOVIE}/${id}/changes`,
|
||||
options
|
||||
);
|
||||
async changes(id: number, options?: ChangeOptions): Promise<Changes> {
|
||||
return await this.api.get<Changes>(`${BASE_MOVIE}/${id}/changes`, options);
|
||||
}
|
||||
|
||||
async credits(id: number): Promise<Credits> {
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
AppendToResponse,
|
||||
AppendToResponseKeys,
|
||||
ChangeOptions,
|
||||
Changes,
|
||||
ContentRatings,
|
||||
Credits,
|
||||
EpisodeGroups,
|
||||
@@ -23,7 +24,6 @@ import {
|
||||
SimilarTvShows,
|
||||
TopRatedTvShows,
|
||||
Translations,
|
||||
TvShowChanges,
|
||||
TvShowDetails,
|
||||
TvShowsAiringToday,
|
||||
Videos,
|
||||
@@ -58,11 +58,8 @@ export class TvShowsEndpoint extends BaseEndpoint {
|
||||
);
|
||||
}
|
||||
|
||||
async changes(id: number, options?: ChangeOptions): Promise<TvShowChanges> {
|
||||
return await this.api.get<TvShowChanges>(
|
||||
`${BASE_TV}/${id}/changes`,
|
||||
options
|
||||
);
|
||||
async changes(id: number, options?: ChangeOptions): Promise<Changes> {
|
||||
return await this.api.get<Changes>(`${BASE_TV}/${id}/changes`, options);
|
||||
}
|
||||
|
||||
async contentRatings(id: number): Promise<ContentRatings> {
|
||||
|
||||
Reference in New Issue
Block a user