@@ -43,6 +43,11 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
43
43
/**
44
44
* @summary List all pets
45
45
*/
46
+ export type listPetsResponse = {
47
+ data : Pets ;
48
+ status : number ;
49
+ } ;
50
+
46
51
export const getListPetsUrl = ( params ?: ListPetsParams ) => {
47
52
const normalizedParams = new URLSearchParams ( ) ;
48
53
@@ -60,8 +65,8 @@ export const getListPetsUrl = (params?: ListPetsParams) => {
60
65
export const listPets = async (
61
66
params ?: ListPetsParams ,
62
67
options ?: RequestInit ,
63
- ) : Promise < Pets > => {
64
- return customFetch < Promise < Pets > > ( getListPetsUrl ( params ) , {
68
+ ) : Promise < listPetsResponse > => {
69
+ return customFetch < Promise < listPetsResponse > > ( getListPetsUrl ( params ) , {
65
70
...options ,
66
71
method : 'GET' ,
67
72
} ) ;
@@ -70,15 +75,20 @@ export const listPets = async (
70
75
/**
71
76
* @summary Create a pet
72
77
*/
78
+ export type createPetsResponse = {
79
+ data : Pet ;
80
+ status : number ;
81
+ } ;
82
+
73
83
export const getCreatePetsUrl = ( ) => {
74
84
return `http://localhost:3000/pets` ;
75
85
} ;
76
86
77
87
export const createPets = async (
78
88
createPetsBodyItem : CreatePetsBodyItem [ ] ,
79
89
options ?: RequestInit ,
80
- ) : Promise < Pet > => {
81
- return customFetch < Promise < Pet > > ( getCreatePetsUrl ( ) , {
90
+ ) : Promise < createPetsResponse > => {
91
+ return customFetch < Promise < createPetsResponse > > ( getCreatePetsUrl ( ) , {
82
92
...options ,
83
93
method : 'POST' ,
84
94
body : JSON . stringify ( createPetsBodyItem ) ,
@@ -88,15 +98,20 @@ export const createPets = async (
88
98
/**
89
99
* @summary Update a pet
90
100
*/
101
+ export type updatePetsResponse = {
102
+ data : Pet ;
103
+ status : number ;
104
+ } ;
105
+
91
106
export const getUpdatePetsUrl = ( ) => {
92
107
return `http://localhost:3000/pets` ;
93
108
} ;
94
109
95
110
export const updatePets = async (
96
111
pet : NonReadonly < Pet > ,
97
112
options ?: RequestInit ,
98
- ) : Promise < Pet > => {
99
- return customFetch < Promise < Pet > > ( getUpdatePetsUrl ( ) , {
113
+ ) : Promise < updatePetsResponse > => {
114
+ return customFetch < Promise < updatePetsResponse > > ( getUpdatePetsUrl ( ) , {
100
115
...options ,
101
116
method : 'PUT' ,
102
117
body : JSON . stringify ( pet ) ,
@@ -106,15 +121,20 @@ export const updatePets = async (
106
121
/**
107
122
* @summary Info for a specific pet
108
123
*/
124
+ export type showPetByIdResponse = {
125
+ data : Pet ;
126
+ status : number ;
127
+ } ;
128
+
109
129
export const getShowPetByIdUrl = ( petId : string ) => {
110
130
return `http://localhost:3000/pets/${ petId } ` ;
111
131
} ;
112
132
113
133
export const showPetById = async (
114
134
petId : string ,
115
135
options ?: RequestInit ,
116
- ) : Promise < Pet > => {
117
- return customFetch < Promise < Pet > > ( getShowPetByIdUrl ( petId ) , {
136
+ ) : Promise < showPetByIdResponse > => {
137
+ return customFetch < Promise < showPetByIdResponse > > ( getShowPetByIdUrl ( petId ) , {
118
138
...options ,
119
139
method : 'GET' ,
120
140
} ) ;
0 commit comments