This commit is contained in:
Ankit Mahato
2024-03-15 04:50:32 +05:30
parent 5b28debd35
commit 3e2cc90263
2 changed files with 5 additions and 4 deletions

View File

@ -12,7 +12,7 @@ class FetchCodeGen {
String kStringImportNode = """
import fetch from 'node-fetch'
{% if hasFormData -%}
import { fileFromSync, FormData } from 'node-fetch'
import { {% if hasFileInFormData %}fileFromSync, {% endif %}FormData } from 'node-fetch'
{% endif %}
""";
@ -57,6 +57,7 @@ fetch(url, options)
jj.Template kNodejsImportTemplate = jj.Template(kStringImportNode);
String importsData = kNodejsImportTemplate.render({
"hasFormData": requestModel.hasFormData,
"hasFileInFormData": requestModel.hasFileInFormData,
});
String result = isNodeJs