MT#62025 Send Fax 422 error bugfix

/api/faxes endpoint was returning a 422 error
Uprocessable content. This commit
amends the payload to match what is in the
APIv1 documentation (old docs)

Change-Id: Ib8d9c0ec41e1e1a18bbe503db711b55e5f66e050
mr13.3
Debora Crescenzo 8 months ago
parent 9a54095693
commit 47d4627980

@ -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
})
}

Loading…
Cancel
Save