File tree Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class AxiosCodeGen {
10
10
final bool isNodeJs;
11
11
12
12
String kStringImportNode = """import axios from 'axios';
13
- {%if hasFormData -%}
13
+ {%if hasFileInFormData -%}
14
14
import fs from 'fs'
15
15
{% endif %}
16
16
@@ -52,12 +52,12 @@ axios(config)
52
52
try {
53
53
jj.Template kNodejsImportTemplate = jj.Template (kStringImportNode);
54
54
String importsData = kNodejsImportTemplate.render ({
55
- "hasFormData " : requestModel.hasFormData ,
55
+ "hasFileInFormData " : requestModel.hasFileInFormData ,
56
56
});
57
57
58
58
String result = isNodeJs
59
59
? importsData
60
- : requestModel.hasFormData
60
+ : requestModel.hasFileInFormData
61
61
? "// refer https://github.com/foss42/apidash/issues/293#issuecomment-1997568083 for details regarding integration\n\n "
62
62
: "" ;
63
63
var harJson = requestModelToHARJsonRequest (
Original file line number Diff line number Diff line change @@ -410,10 +410,7 @@ axios(config)
410
410
expectedCode);
411
411
});
412
412
test ('POST 4' , () {
413
- const expectedCode =
414
- r"""// refer https://github.com/foss42/apidash/issues/293#issuecomment-1997568083 for details regarding integration
415
-
416
- const config = {
413
+ const expectedCode = r"""const config = {
417
414
url: 'https://api.apidash.dev/io/form',
418
415
method: 'post',
419
416
headers: {
@@ -445,10 +442,7 @@ axios(config)
445
442
});
446
443
447
444
test ('POST 5' , () {
448
- const expectedCode =
449
- r"""// refer https://github.com/foss42/apidash/issues/293#issuecomment-1997568083 for details regarding integration
450
-
451
- const config = {
445
+ const expectedCode = r"""const config = {
452
446
url: 'https://api.apidash.dev/io/form',
453
447
method: 'post',
454
448
headers: {
@@ -546,10 +540,7 @@ axios(config)
546
540
expectedCode);
547
541
});
548
542
test ('POST 8' , () {
549
- const expectedCode =
550
- r"""// refer https://github.com/foss42/apidash/issues/293#issuecomment-1997568083 for details regarding integration
551
-
552
- const config = {
543
+ const expectedCode = r"""const config = {
553
544
url: 'https://api.apidash.dev/io/form',
554
545
method: 'post',
555
546
params: {
Original file line number Diff line number Diff line change @@ -461,7 +461,6 @@ axios(config)
461
461
});
462
462
test ('POST 4' , () {
463
463
const expectedCode = r"""import axios from 'axios';
464
- import fs from 'fs'
465
464
466
465
const config = {
467
466
url: 'https://api.apidash.dev/io/form',
@@ -496,7 +495,6 @@ axios(config)
496
495
497
496
test ('POST 5' , () {
498
497
const expectedCode = r"""import axios from 'axios';
499
- import fs from 'fs'
500
498
501
499
const config = {
502
500
url: 'https://api.apidash.dev/io/form',
@@ -597,7 +595,6 @@ axios(config)
597
595
});
598
596
test ('POST 8' , () {
599
597
const expectedCode = r"""import axios from 'axios';
600
- import fs from 'fs'
601
598
602
599
const config = {
603
600
url: 'https://api.apidash.dev/io/form',
You can’t perform that action at this time.
0 commit comments