Skip to content

Commit 3c329d2

Browse files
fix: remove fn async #477
1 parent 103648c commit 3c329d2

File tree

52 files changed

+1255
-1323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1255
-1323
lines changed

.changeset/cold-lands-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openapi-ts-request': patch
3+
---
4+
5+
fix: remove fn async #477

templates/reactQuery.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import * as apis from './{{ className }}';
6060
{%- endif -%}
6161
) {
6262
return queryOptions({
63-
queryFn: async ({ queryKey }) => {
63+
queryFn: ({ queryKey }) => {
6464
return apis.{{ api.functionName }}(queryKey[1]{{ " as typeof options" if genType === "ts" }});
6565
},
6666
queryKey: ['{{ api.functionName }}', options],

templates/serviceController.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{{ api.data }}
1313
{% else %}
1414
/** {{ api.desc if api.desc else '此处后端没有提供注释' }} {{ api.method | upper }} {{ api.pathInComment | safe }}{{ ' ' if api.apifoxRunLink else '' }}{{ api.apifoxRunLink }} */
15-
export async function {{ api.functionName }}({
15+
export function {{ api.functionName }}({
1616
{%- if api.params and api.hasParams %}
1717
params
1818
{%- if api.hasParams -%}

test/__snapshots__/both/should both excludeTags and excludePaths works while excludePaths has wildcard.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import request from '../request';
2626
import * as API from './types';
2727

2828
/** f1 ffff GET /user-z/z1 */
29-
export async function userZz1UsingGet({
29+
export function userZz1UsingGet({
3030
options,
3131
}: {
3232
options?: { [key: string]: unknown };
@@ -38,7 +38,7 @@ export async function userZz1UsingGet({
3838
}
3939

4040
/** z1/zz1 GET /user-z/z1/zz1 */
41-
export async function userZz1Zz1UsingGet({
41+
export function userZz1Zz1UsingGet({
4242
options,
4343
}: {
4444
options?: { [key: string]: unknown };

test/__snapshots__/both/should both excludeTags and excludePaths works with includeTags.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import request from '../request';
1919
import * as API from './types';
2020

2121
/** f1 ffff GET /user-z/z1 */
22-
export async function userZz1UsingGet({
22+
export function userZz1UsingGet({
2323
options,
2424
}: {
2525
options?: { [key: string]: unknown };

test/__snapshots__/both/should exclude items from includePaths and includeTags.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import request from '../request';
1010
import * as API from './types';
1111

1212
/** a1 GET /sys-a/a1 */
13-
export async function sysAa1UsingGet({
13+
export function sysAa1UsingGet({
1414
options,
1515
}: {
1616
options?: { [key: string]: unknown };

test/__snapshots__/both/should return all while includeTags match all.snap

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import request from '../request';
1515
import * as API from './types';
1616

1717
/** a1 GET /sys-a/a1 */
18-
export async function sysAa1UsingGet({
18+
export function sysAa1UsingGet({
1919
options,
2020
}: {
2121
options?: { [key: string]: unknown };
@@ -27,7 +27,7 @@ export async function sysAa1UsingGet({
2727
}
2828

2929
/** a1/aa1 GET /sys-a/a1/aa1 */
30-
export async function sysAa1Aa1UsingGet({
30+
export function sysAa1Aa1UsingGet({
3131
options,
3232
}: {
3333
options?: { [key: string]: unknown };
@@ -39,7 +39,7 @@ export async function sysAa1Aa1UsingGet({
3939
}
4040

4141
/** a1/a1/aa1 GET /sys-a/a1/aa1/aaa1 */
42-
export async function sysAa1Aa1Aaa1UsingGet({
42+
export function sysAa1Aa1Aaa1UsingGet({
4343
options,
4444
}: {
4545
options?: { [key: string]: unknown };
@@ -51,7 +51,7 @@ export async function sysAa1Aa1Aaa1UsingGet({
5151
}
5252

5353
/** a1/a1/aa1/aaa1 GET /sys-a/a1/aa1/aaa1/aaaa1 */
54-
export async function sysAa1Aa1Aaa1Aaaa1UsingGet({
54+
export function sysAa1Aa1Aaa1Aaaa1UsingGet({
5555
options,
5656
}: {
5757
options?: { [key: string]: unknown };
@@ -68,7 +68,7 @@ import request from '../request';
6868
import * as API from './types';
6969

7070
/** b1 GET /sys-b/b1 */
71-
export async function sysBb1UsingGet({
71+
export function sysBb1UsingGet({
7272
options,
7373
}: {
7474
options?: { [key: string]: unknown };
@@ -80,7 +80,7 @@ export async function sysBb1UsingGet({
8080
}
8181

8282
/** b1/bb1 GET /sys-b/b1/bb1 */
83-
export async function sysBb1Bb1UsingGet({
83+
export function sysBb1Bb1UsingGet({
8484
options,
8585
}: {
8686
options?: { [key: string]: unknown };
@@ -92,7 +92,7 @@ export async function sysBb1Bb1UsingGet({
9292
}
9393

9494
/** b1/bb1/bbb1 GET /sys-b/b1/bb1/bbb1 */
95-
export async function sysBb1Bb1Bbb1UsingGet({
95+
export function sysBb1Bb1Bbb1UsingGet({
9696
options,
9797
}: {
9898
options?: { [key: string]: unknown };
@@ -104,7 +104,7 @@ export async function sysBb1Bb1Bbb1UsingGet({
104104
}
105105

106106
/** b1/bb1/bbb1/bbbb1 GET /sys-b/b1/bb1/bbb1/bbbb1 */
107-
export async function sysBb1Bb1Bbb1Bbbb1UsingGet({
107+
export function sysBb1Bb1Bbb1Bbbb1UsingGet({
108108
options,
109109
}: {
110110
options?: { [key: string]: unknown };
@@ -121,7 +121,7 @@ import request from '../request';
121121
import * as API from './types';
122122

123123
/** c1 GET /sys-c/c1 */
124-
export async function sysCc1UsingGet({
124+
export function sysCc1UsingGet({
125125
options,
126126
}: {
127127
options?: { [key: string]: unknown };
@@ -133,7 +133,7 @@ export async function sysCc1UsingGet({
133133
}
134134

135135
/** c1/cc1 GET /sys-c/c1/cc1 */
136-
export async function sysCc1Cc1UsingGet({
136+
export function sysCc1Cc1UsingGet({
137137
options,
138138
}: {
139139
options?: { [key: string]: unknown };
@@ -145,7 +145,7 @@ export async function sysCc1Cc1UsingGet({
145145
}
146146

147147
/** c1/cc1/ccc1 GET /sys-c/c1/cc1/ccc1 */
148-
export async function sysCc1Cc1Ccc1UsingGet({
148+
export function sysCc1Cc1Ccc1UsingGet({
149149
options,
150150
}: {
151151
options?: { [key: string]: unknown };
@@ -157,7 +157,7 @@ export async function sysCc1Cc1Ccc1UsingGet({
157157
}
158158

159159
/** c1/cc1/ccc1/cccc1 GET /sys-c/c1/cc1/ccc1/cccc1 */
160-
export async function sysCc1Cc1Ccc1Cccc1UsingGet({
160+
export function sysCc1Cc1Ccc1Cccc1UsingGet({
161161
options,
162162
}: {
163163
options?: { [key: string]: unknown };
@@ -358,7 +358,7 @@ import request from '../request';
358358
import * as API from './types';
359359

360360
/** x1 GET /user-x/x1 */
361-
export async function userXx1UsingGet({
361+
export function userXx1UsingGet({
362362
options,
363363
}: {
364364
options?: { [key: string]: unknown };
@@ -370,7 +370,7 @@ export async function userXx1UsingGet({
370370
}
371371

372372
/** x1/xx1 GET /user-x/x1/xx1 */
373-
export async function userXx1Xx1UsingGet({
373+
export function userXx1Xx1UsingGet({
374374
options,
375375
}: {
376376
options?: { [key: string]: unknown };
@@ -382,7 +382,7 @@ export async function userXx1Xx1UsingGet({
382382
}
383383

384384
/** x1/xx1/xxx1 GET /user-x/x1/xx1/xxx1 */
385-
export async function userXx1Xx1Xxx1UsingGet({
385+
export function userXx1Xx1Xxx1UsingGet({
386386
options,
387387
}: {
388388
options?: { [key: string]: unknown };
@@ -394,7 +394,7 @@ export async function userXx1Xx1Xxx1UsingGet({
394394
}
395395

396396
/** x1/xx1/xxx1/xxxx1 GET /user-x/x1/xx1/xxx1/xxxx1 */
397-
export async function userXx1Xx1Xxx1Xxxx1UsingGet({
397+
export function userXx1Xx1Xxx1Xxxx1UsingGet({
398398
options,
399399
}: {
400400
options?: { [key: string]: unknown };
@@ -411,7 +411,7 @@ import request from '../request';
411411
import * as API from './types';
412412

413413
/** y1 GET /user-y/y1 */
414-
export async function userYy1UsingGet({
414+
export function userYy1UsingGet({
415415
options,
416416
}: {
417417
options?: { [key: string]: unknown };
@@ -423,7 +423,7 @@ export async function userYy1UsingGet({
423423
}
424424

425425
/** y1/yy1 GET /user-y/y1/yy1 */
426-
export async function userYy1Yy1UsingGet({
426+
export function userYy1Yy1UsingGet({
427427
options,
428428
}: {
429429
options?: { [key: string]: unknown };
@@ -435,7 +435,7 @@ export async function userYy1Yy1UsingGet({
435435
}
436436

437437
/** y1/yy1/yyy1 GET /user-y/y1/yy1/yyy1 */
438-
export async function userYy1Yy1Yyy1UsingGet({
438+
export function userYy1Yy1Yyy1UsingGet({
439439
options,
440440
}: {
441441
options?: { [key: string]: unknown };
@@ -447,7 +447,7 @@ export async function userYy1Yy1Yyy1UsingGet({
447447
}
448448

449449
/** y1/yy1/yyy1/yyyy1 GET /user-y/y1/yy1/yyy1/yyyy1 */
450-
export async function userYy1Yy1Yyy1Yyyy1UsingGet({
450+
export function userYy1Yy1Yyy1Yyyy1UsingGet({
451451
options,
452452
}: {
453453
options?: { [key: string]: unknown };
@@ -459,7 +459,7 @@ export async function userYy1Yy1Yyy1Yyyy1UsingGet({
459459
}
460460

461461
/** y1/yy1/yyy1/yyyy1/yyyyy1 GET /user-y/y1/yy1/yyy1/yyyy1/yyyyy1 */
462-
export async function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({
462+
export function userYy1Yy1Yyy1Yyyy1Yyyyy1UsingGet({
463463
options,
464464
}: {
465465
options?: { [key: string]: unknown };
@@ -476,7 +476,7 @@ import request from '../request';
476476
import * as API from './types';
477477

478478
/** f1 ffff GET /user-z/z1 */
479-
export async function userZz1UsingGet({
479+
export function userZz1UsingGet({
480480
options,
481481
}: {
482482
options?: { [key: string]: unknown };
@@ -488,7 +488,7 @@ export async function userZz1UsingGet({
488488
}
489489

490490
/** z1/zz1 GET /user-z/z1/zz1 */
491-
export async function userZz1Zz1UsingGet({
491+
export function userZz1Zz1UsingGet({
492492
options,
493493
}: {
494494
options?: { [key: string]: unknown };
@@ -500,7 +500,7 @@ export async function userZz1Zz1UsingGet({
500500
}
501501

502502
/** z1/zz1/zzz1 GET /user-z/z1/zz1/zzz1 */
503-
export async function userZz1Zz1Zzz1UsingGet({
503+
export function userZz1Zz1Zzz1UsingGet({
504504
options,
505505
}: {
506506
options?: { [key: string]: unknown };
@@ -512,7 +512,7 @@ export async function userZz1Zz1Zzz1UsingGet({
512512
}
513513

514514
/** z1/zz1/zzz1/zzzz1 GET /user-z/z1/zz1/zzz1/zzzz1 */
515-
export async function userZz1Zz1Zzz1Zzzz1UsingGet({
515+
export function userZz1Zz1Zzz1Zzzz1UsingGet({
516516
options,
517517
}: {
518518
options?: { [key: string]: unknown };
@@ -524,7 +524,7 @@ export async function userZz1Zz1Zzz1Zzzz1UsingGet({
524524
}
525525

526526
/** z1/zz1/zzz1/zzzz1/zzzzz1 GET /user-z/z1/zz1/zzz1/zzzz1/zzzzz1 */
527-
export async function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({
527+
export function userZz1Zz1Zzz1Zzzz1Zzzzz1UsingGet({
528528
options,
529529
}: {
530530
options?: { [key: string]: unknown };

0 commit comments

Comments
 (0)