diff --git a/TESTDATA.md b/TESTDATA.md index 5a4a74b3..eb97630a 100644 --- a/TESTDATA.md +++ b/TESTDATA.md @@ -67,7 +67,6 @@ For outgoing you need to use the api (also with E 164 number set to sms number f username: '' ` 1. Apply the exim configuration changes via `sudo ngcpcfg apply 'adjust exim4 / MTA configuration'` -1. For the rest of the prompts, press enter to choose the defaults 1. Go to Settings > Subscribers, find subscriber you want to use as caller, and click "Details" 1. Under "Master Data" click edit, and enter subscribers number also in the E164 field 1. Then go to "Preferences", and set "Fax2Mail and Sendfax" to active diff --git a/src/api/communication.js b/src/api/communication.js index 4523638f..0bd32031 100644 --- a/src/api/communication.js +++ b/src/api/communication.js @@ -1,14 +1,18 @@ +import _ from 'lodash'; import Vue from 'vue'; -export function createFax(options, subscriberId) { +export function createFax(options) { return new Promise((resolve, reject) => { - let headers = { - 'Content-Type': 'application/json', - }; - let mergedParams = Object.assign(options, subscriberId); - let payload = JSON.stringify(mergedParams); - Vue.http.post('api/faxes/', payload, { headers: headers }).then(() => { + var formData = new FormData(); + var fields = _.clone(options); + delete fields.file; + var json = JSON.stringify(fields); + formData.append('json', json); + if (options.file) { + formData.append('faxfile', options.file); + } + Vue.http.post('api/faxes/', formData).then(() => { resolve(); }).catch((err)=>{ reject(err); diff --git a/src/components/CscSendFax.vue b/src/components/CscSendFax.vue index a262f94d..c0398023 100644 --- a/src/components/CscSendFax.vue +++ b/src/components/CscSendFax.vue @@ -7,55 +7,139 @@
{{ $t('communication.sendFax') }}
- + + :float-label="$t('communication.label.destination')" + @input="$v.form.destination.$touch" + @blur="$v.form.destination.$touch" + :error="$v.form.destination.$error" + /> + :float-label="$t('communication.label.quality')" + /> - + + v-model="form.pageHeader" + :float-label="$t('communication.label.pageHeader')" + @input="$v.form.pageHeader.$touch" + @blur="$v.form.pageHeader.$touch" + :error="$v.form.pageHeader.$error" + /> - + + :float-label="$t('communication.label.content')" + @input="$v.form.data.$touch" + @blur="$v.form.data.$touch" + :error="$v.form.data.$error" + /> + + + + - {{ $t('communication.cancel') }} - {{ $t('communication.send') }} +
+ {{ fileErrorMessage }} +
+ + {{ $t('communication.cancel') }} + + + {{ $t('communication.send') }} +