moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
293 stars 119 forks source link

Can't call service with `busboyConfig` option `empty: true` #241

Closed intech closed 3 years ago

intech commented 3 years ago

We need to change the service invocation behavior when using multipart. If we use FormData, in which the file is not transferred, then we will never receive a service call, since promises for calls are collected in the busboy file event https://github.com/moleculerjs/moleculer-web/blob/master/src/alias.js#L163-L172

icebob commented 3 years ago

Thanks, I will check it.

intech commented 3 years ago

test repo: https://codesandbox.io/s/moleculer-api-routing-forked-2xfmi?file=/services/api.service.js

icebob commented 3 years ago

I can't reproduce it locally. I see it's wrong in codesandbox example. But locally (npm run dev file) it's called with an empty file stream and create an empty file if no file selected.

icebob commented 3 years ago

Please try with 0.10.0-beta4: https://github.com/moleculerjs/moleculer-web/blob/master/CHANGELOG.md#multipart-fields--url-params

intech commented 3 years ago

@icebob everything is working! Excellent work, thank you!