mirror of
https://github.com/foss42/apidash.git
synced 2025-05-28 20:27:04 +08:00
Merge pull request #4 from vidya-hub/form_data_code_gen
chore: fixed spacing issues in nodejs axios codegen
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user