fix: oapi shitty generation
This commit is contained in:
parent
cb9fba6fbc
commit
68294dd13c
16 changed files with 302 additions and 288 deletions
|
|
@ -9,6 +9,7 @@ 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 { UserTitleMini } from '../models/UserTitleMini';
|
||||
import type { UserTitleStatus } from '../models/UserTitleStatus';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
|
|
@ -78,7 +79,7 @@ export class DefaultService {
|
|||
* @returns Title Title description
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getTitles1(
|
||||
public static getTitle(
|
||||
titleId: number,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<Title> {
|
||||
|
|
@ -105,7 +106,7 @@ export class DefaultService {
|
|||
* @returns User User info
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getUsers(
|
||||
public static getUsersId(
|
||||
userId: string,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<User> {
|
||||
|
|
@ -248,22 +249,17 @@ export class DefaultService {
|
|||
* User adding title to list af watched, status required
|
||||
* @param userId ID of the user to assign the title to
|
||||
* @param requestBody
|
||||
* @returns any Title successfully added to user
|
||||
* @returns UserTitleMini Title successfully added to user
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static addUserTitle(
|
||||
userId: number,
|
||||
requestBody: UserTitle,
|
||||
): CancelablePromise<{
|
||||
data?: {
|
||||
user_id: number;
|
||||
requestBody: {
|
||||
title_id: number;
|
||||
status: UserTitleStatus;
|
||||
rate?: number;
|
||||
review_id?: number;
|
||||
ctime?: string;
|
||||
};
|
||||
}> {
|
||||
},
|
||||
): CancelablePromise<UserTitleMini> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/users/{user_id}/titles',
|
||||
|
|
@ -282,4 +278,37 @@ export class DefaultService {
|
|||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Update a usertitle
|
||||
* User updating title list of watched
|
||||
* @param userId ID of the user to assign the title to
|
||||
* @param requestBody
|
||||
* @returns UserTitleMini Title successfully updated
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateUserTitle(
|
||||
userId: number,
|
||||
requestBody: {
|
||||
title_id: number;
|
||||
status?: UserTitleStatus;
|
||||
rate?: number;
|
||||
},
|
||||
): CancelablePromise<UserTitleMini> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PATCH',
|
||||
url: '/users/{user_id}/titles',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
400: `Invalid request body (missing fields, invalid types, etc.)`,
|
||||
401: `Unauthorized — missing or invalid auth token`,
|
||||
403: `Forbidden — user not allowed to update title`,
|
||||
404: `User or Title not found`,
|
||||
500: `Internal server error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue