diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 22e17233a6..b32dd5fba5 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -104,11 +104,10 @@ export function createActionToSignatureMapper() { ]; signature.parameters = parameters.map(p => { - const isFormData = isRemoteStreamContent(p.typeSimple); - if (isFormData) { - const formDataParameter = new Property({ name: p.name, type: 'FormData' }); - formDataParameter.setOptional(false); - return formDataParameter; + const isFormData = isRemoteStreamContent(p.type); + const isFormArray = isRemoteStreamContentArray(p.type); + if (isFormData || isFormArray) { + return new Property({ name: p.name, type: 'FormData' }); } const type = adaptType(p.typeSimple); const parameter = new Property({ name: p.name, type }); @@ -126,6 +125,10 @@ export function isRemoteStreamContent(type: string) { return VOLO_REMOTE_STREAM_CONTENT.some(x => x === type); } +export function isRemoteStreamContentArray(type: string) { + return VOLO_REMOTE_STREAM_CONTENT.map(x => `${x}[]`).some(x => x === type); +} + function getMethodNameFromAction(action: Action): string { return action.uniqueName.split('Async')[0]; }