Bug 32030: ERM - Fix Header issue

Object { message: "Expected application/json - got text/plain;charset=UTF-8.", path: "/body" }

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-03-30 11:21:04 +02:00 committed by Tomas Cohen Arazi
parent d8ff532551
commit 0a3ede141d
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 12 additions and 10 deletions

View File

@ -165,7 +165,9 @@
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit" />
<a href="#" class="cancel" @click="$emit('switch-view', 'list')">Cancel</a>
<a href="#" class="cancel" @click="$emit('switch-view', 'list')"
>Cancel</a
>
</fieldset>
</form>
</div>
@ -217,9 +219,6 @@ export default {
let agreement = JSON.parse(JSON.stringify(this.agreement)) // copy
let apiUrl = '/api/v1/erm/agreements'
const myHeaders = new Headers()
myHeaders.append('Content-Type', 'application/json')
let method = 'POST'
if (agreement.agreement_id) {
method = 'PUT'
@ -241,7 +240,9 @@ export default {
const options = {
method: method,
body: JSON.stringify(agreement),
myHeaders
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
}
fetch(apiUrl, options)

View File

@ -17,7 +17,9 @@
</fieldset>
<fieldset class="action">
<input type="submit" variant="primary" value="Yes, delete" />
<a href="#" class="cancel" @click="$emit('switch-view', 'list')">No, do not delete</a>
<a href="#" class="cancel" @click="$emit('switch-view', 'list')"
>No, do not delete</a
>
</fieldset>
</form>
</div>
@ -52,12 +54,11 @@ export default {
let apiUrl = '/api/v1/erm/agreements/' + this.agreement_id
const myHeaders = new Headers()
myHeaders.append('Content-Type', 'application/json')
const options = {
method: 'DELETE',
myHeaders
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
}
fetch(apiUrl, options)