Skip to content

Commit

Permalink
update openapi.json & openapi-ts client, run pnpm format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 17, 2024
1 parent 73bd5af commit 294bc62
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 33 deletions.
16 changes: 6 additions & 10 deletions frontend/src/lib/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,10 @@ export const ChildCreateSchema = {
birth_month: {
type: 'integer',
title: 'Birth Month'
},
has_image: {
type: 'boolean',
title: 'Has Image'
}
},
type: 'object',
required: ['birth_year', 'birth_month', 'has_image'],
required: ['birth_year', 'birth_month'],
title: 'ChildCreate'
} as const;

Expand All @@ -189,17 +185,17 @@ export const ChildPublicSchema = {
type: 'integer',
title: 'Birth Month'
},
has_image: {
type: 'boolean',
title: 'Has Image'
},
id: {
type: 'integer',
title: 'Id'
},
has_image: {
type: 'boolean',
title: 'Has Image'
}
},
type: 'object',
required: ['birth_year', 'birth_month', 'has_image', 'id'],
required: ['birth_year', 'birth_month', 'id', 'has_image'],
title: 'ChildPublic'
} as const;

Expand Down
24 changes: 12 additions & 12 deletions frontend/src/lib/client/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ import type {
UsersDeleteUserResponse,
GetChildrenError,
GetChildrenResponse,
CreateChildData,
CreateChildError,
CreateChildResponse,
UpdateChildData,
UpdateChildError,
UpdateChildResponse,
CreateChildData,
CreateChildError,
CreateChildResponse,
DeleteChildData,
DeleteChildError,
DeleteChildResponse,
Expand Down Expand Up @@ -564,26 +564,26 @@ export const getChildren = <ThrowOnError extends boolean = false>(
};

/**
* Create Child
* Update Child
*/
export const createChild = <ThrowOnError extends boolean = false>(
options: Options<CreateChildData, ThrowOnError>
export const updateChild = <ThrowOnError extends boolean = false>(
options: Options<UpdateChildData, ThrowOnError>
) => {
return (options?.client ?? client).post<CreateChildResponse, CreateChildError, ThrowOnError>({
return (options?.client ?? client).put<UpdateChildResponse, UpdateChildError, ThrowOnError>({
...options,
url: '/users/children/'
});
};

/**
* Update Child
* Create Child
*/
export const updateChild = <ThrowOnError extends boolean = false>(
options: Options<UpdateChildData, ThrowOnError>
export const createChild = <ThrowOnError extends boolean = false>(
options: Options<CreateChildData, ThrowOnError>
) => {
return (options?.client ?? client).put<UpdateChildResponse, UpdateChildError, ThrowOnError>({
return (options?.client ?? client).post<CreateChildResponse, CreateChildError, ThrowOnError>({
...options,
url: '/users/children'
url: '/users/children/'
});
};

Expand Down
19 changes: 9 additions & 10 deletions frontend/src/lib/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,14 @@ export type ChildCreate = {
name?: string;
birth_year: number;
birth_month: number;
has_image: boolean;
};

export type ChildPublic = {
name?: string;
birth_year: number;
birth_month: number;
has_image: boolean;
id: number;
has_image: boolean;
};

export type ErrorModel = {
Expand Down Expand Up @@ -447,14 +446,6 @@ export type GetChildrenResponse = Array<ChildPublic>;

export type GetChildrenError = unknown;

export type CreateChildData = {
body: ChildCreate;
};

export type CreateChildResponse = ChildPublic;

export type CreateChildError = HTTPValidationError;

export type UpdateChildData = {
body: ChildPublic;
};
Expand All @@ -463,6 +454,14 @@ export type UpdateChildResponse = ChildPublic;

export type UpdateChildError = HTTPValidationError;

export type CreateChildData = {
body: ChildCreate;
};

export type CreateChildResponse = ChildPublic;

export type CreateChildError = HTTPValidationError;

export type DeleteChildData = {
path: {
child_id: number;
Expand Down
2 changes: 1 addition & 1 deletion mondey_backend/openapi.json

Large diffs are not rendered by default.

0 comments on commit 294bc62

Please sign in to comment.