Fixed the api for unavailable requests

pull/3895/head
Jamie Rees 5 years ago
parent 982455bc4e
commit ac1266bf6e

@ -8,7 +8,8 @@ namespace Ombi.Core.Engine.Interfaces
{ {
public interface ITvRequestEngine : IRequestEngine<TvRequests> public interface ITvRequestEngine : IRequestEngine<TvRequests>
{ {
Task<RequestsViewModel<ChildRequests>> GetUnavailableRequests(int count, int position, string sortProperty,
string sortOrder);
Task RemoveTvRequest(int requestId); Task RemoveTvRequest(int requestId);
Task<TvRequests> GetTvRequest(int requestId); Task<TvRequests> GetTvRequest(int requestId);
Task<RequestEngineResult> RequestTvShow(TvRequestViewModel tv); Task<RequestEngineResult> RequestTvShow(TvRequestViewModel tv);

@ -24,4 +24,13 @@ export class RequestServiceV2 extends ServiceHelpers {
public updateMovieAdvancedOptions(options: IMovieAdvancedOptions): Observable<IRequestEngineResult> { public updateMovieAdvancedOptions(options: IMovieAdvancedOptions): Observable<IRequestEngineResult> {
return this.http.post<IRequestEngineResult>(`${this.url}movie/advancedoptions`, options, {headers: this.headers}); return this.http.post<IRequestEngineResult>(`${this.url}movie/advancedoptions`, options, {headers: this.headers});
} }
public getMovieUnavailableRequests(count: number, position: number, sortProperty: string , order: string): Observable<IRequestsViewModel<IMovieRequests>> {
return this.http.get<IRequestsViewModel<IMovieRequests>>(`${this.url}movie/unavailable/${count}/${position}/${sortProperty}/${order}`, {headers: this.headers});
}
public getTvUnavailableRequests(count: number, position: number, sortProperty: string , order: string): Observable<IRequestsViewModel<IChildRequests>> {
return this.http.get<IRequestsViewModel<IChildRequests>>(`${this.url}tv/unavailable/${count}/${position}/${sortProperty}/${order}`, {headers: this.headers});
}
} }

@ -69,10 +69,10 @@ namespace Ombi.Controllers.V2
/// <param name="position">The position. e.g. position 60 for a 2nd page (since we have already got the first 30 items)</param> /// <param name="position">The position. e.g. position 60 for a 2nd page (since we have already got the first 30 items)</param>
/// <param name="sort">The item to sort on e.g. "requestDate"</param> /// <param name="sort">The item to sort on e.g. "requestDate"</param>
/// <param name="sortOrder">asc or desc</param> /// <param name="sortOrder">asc or desc</param>
[HttpGet("tv/{count:int}/{position:int}/{sort}/{sortOrder}")] [HttpGet("tv/unavailable/{count:int}/{position:int}/{sort}/{sortOrder}")]
public async Task<RequestsViewModel<ChildRequests>> GetNotAvailableTvRequests(int count, int position, string sort, string sortOrder) public async Task<RequestsViewModel<ChildRequests>> GetNotAvailableTvRequests(int count, int position, string sort, string sortOrder)
{ {
return await _tvRequestEngine.GetRequests(count, position, sort, sortOrder); return await _tvRequestEngine.GetUnavailableRequests(count, position, sort, sortOrder);
} }
[HttpPost("movie/advancedoptions")] [HttpPost("movie/advancedoptions")]

Loading…
Cancel
Save