diff --git a/src/api/communication.js b/src/api/communication.js index cf305aa6..f7c88eb9 100644 --- a/src/api/communication.js +++ b/src/api/communication.js @@ -1,17 +1,12 @@ -import _ from 'lodash' import { post } from 'src/api/common' export async function createFax (options) { - const formData = new FormData() - const fields = _.clone(options) - delete fields.faxfile - const json = JSON.stringify(fields) - formData.append('json', json) - if (options.faxfile) { - formData.append('faxfile', options.faxfile) + if (options.faxfile === null) { + delete options.faxfile } + return await post({ resource: 'faxes', - body: formData + body: options }) }