feat: /titles page implementation with cursor pagination
This commit is contained in:
parent
a515769823
commit
397d2bcf70
37 changed files with 797 additions and 1247 deletions
|
|
@ -2,17 +2,23 @@
|
|||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { CursorObj } from '../models/CursorObj';
|
||||
import type { ReleaseSeason } from '../models/ReleaseSeason';
|
||||
import type { Title } from '../models/Title';
|
||||
import type { TitleSort } from '../models/TitleSort';
|
||||
import type { TitleStatus } from '../models/TitleStatus';
|
||||
import type { User } from '../models/User';
|
||||
import type { UserTitle } from '../models/UserTitle';
|
||||
import type { UserTitleStatus } from '../models/UserTitleStatus';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class DefaultService {
|
||||
/**
|
||||
* Get titles
|
||||
* @param cursor
|
||||
* @param sort
|
||||
* @param sortForward
|
||||
* @param word
|
||||
* @param status
|
||||
* @param rating
|
||||
|
|
@ -21,10 +27,13 @@ export class DefaultService {
|
|||
* @param limit
|
||||
* @param offset
|
||||
* @param fields
|
||||
* @returns Title List of titles
|
||||
* @returns any List of titles with cursor
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getTitles(
|
||||
cursor?: string,
|
||||
sort?: TitleSort,
|
||||
sortForward: boolean = true,
|
||||
word?: string,
|
||||
status?: TitleStatus,
|
||||
rating?: number,
|
||||
|
|
@ -33,11 +42,20 @@ export class DefaultService {
|
|||
limit: number = 10,
|
||||
offset?: number,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<Array<Title>> {
|
||||
): CancelablePromise<{
|
||||
/**
|
||||
* List of titles
|
||||
*/
|
||||
data: Array<Title>;
|
||||
cursor: CursorObj;
|
||||
}> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/titles',
|
||||
query: {
|
||||
'cursor': cursor,
|
||||
'sort': sort,
|
||||
'sort_forward': sortForward,
|
||||
'word': word,
|
||||
'status': status,
|
||||
'rating': rating,
|
||||
|
|
@ -111,9 +129,13 @@ export class DefaultService {
|
|||
* Get user titles
|
||||
* @param userId
|
||||
* @param cursor
|
||||
* @param query
|
||||
* @param word
|
||||
* @param status
|
||||
* @param watchStatus
|
||||
* @param rating
|
||||
* @param releaseYear
|
||||
* @param releaseSeason
|
||||
* @param limit
|
||||
* @param offset
|
||||
* @param fields
|
||||
* @returns UserTitle List of user titles
|
||||
* @throws ApiError
|
||||
|
|
@ -121,22 +143,30 @@ export class DefaultService {
|
|||
public static getUsersTitles(
|
||||
userId: string,
|
||||
cursor?: string,
|
||||
query?: string,
|
||||
word?: string,
|
||||
status?: TitleStatus,
|
||||
watchStatus?: UserTitleStatus,
|
||||
rating?: number,
|
||||
releaseYear?: number,
|
||||
releaseSeason?: ReleaseSeason,
|
||||
limit: number = 10,
|
||||
offset?: number,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<Array<UserTitle>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/users/{user_id}/titles',
|
||||
url: '/users/{user_id}/titles/',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
query: {
|
||||
'cursor': cursor,
|
||||
'query': query,
|
||||
'word': word,
|
||||
'status': status,
|
||||
'watch_status': watchStatus,
|
||||
'rating': rating,
|
||||
'release_year': releaseYear,
|
||||
'release_season': releaseSeason,
|
||||
'limit': limit,
|
||||
'offset': offset,
|
||||
'fields': fields,
|
||||
},
|
||||
errors: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue