1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-11 14:20:05 +00:00

fix(file-upload-form): fixed form data for node env

This commit is contained in:
Yury Shkoda
2023-07-06 15:49:24 +03:00
parent 22edcb0a8e
commit 0d9ba36de8
7 changed files with 113 additions and 41 deletions

View File

@@ -16,10 +16,11 @@ import { SASViyaApiClient } from '../SASViyaApiClient'
import {
isRelativePath,
parseSasViyaDebugResponse,
appendExtraResponseAttributes
appendExtraResponseAttributes,
parseWeboutResponse,
getFormData
} from '../utils'
import { BaseJobExecutor } from './JobExecutor'
import { parseWeboutResponse } from '../utils/parseWeboutResponse'
export interface WaitingRequstPromise {
promise: Promise<any> | null
@@ -112,8 +113,7 @@ export class WebJobExecutor extends BaseJobExecutor {
* Use the available form data object (FormData in Browser, NodeFormData in
* Node)
*/
let formData =
typeof FormData === 'undefined' ? new NodeFormData() : new FormData()
let formData = getFormData()
if (data) {
const stringifiedData = JSON.stringify(data)