Merge pull request #4 from vidya-hub/form_data_code_gen

chore: fixed spacing issues in nodejs axios codegen
This commit is contained in:
Vidya Sagar
2024-01-07 19:51:41 +05:30
committed by GitHub
2 changed files with 3 additions and 24 deletions

View File

@ -11,9 +11,7 @@ class AxiosCodeGen {
final bool isNodeJs;
String kStringImportNode = """{% if isNodeJs %}import axios from 'axios';
{% endif %}{% if isFormDataRequest and isNodeJs %}
const fs = require('fs');{% endif %}
{% endif %}{% if isFormDataRequest and isNodeJs %}const fs = require('fs');{% endif %}
""";
String kTemplateStart = """let config = {
@ -50,6 +48,8 @@ axios(config)
});
""";
String kMultiPartBodyTemplate = r'''
async function buildFormData(fields) {
var formdata = new FormData();
for (const field of fields) {