Add header to put request to ensure string is sent

This commit is contained in:
samuelmcdermott 2020-10-21 18:43:13 +01:00
parent b111a4e680
commit 97ff8d4049

View file

@ -4,7 +4,7 @@
<h3>Stage settings</h3> <h3>Stage settings</h3>
<p> <p>
<label class="uk-form-label"> <label class="uk-form-label">
Stage Geometry Stage geometry
<div v-if="stageType != 'MissingStage'"> <div v-if="stageType != 'MissingStage'">
<form @submit.prevent="setStageType"> <form @submit.prevent="setStageType">
<div class="uk-margin-small"> <div class="uk-margin-small">
@ -18,7 +18,7 @@
type="submit" type="submit"
class="uk-button uk-button-primary uk-width-1-1" class="uk-button uk-button-primary uk-width-1-1"
> >
Change stage type Change stage geometry
</button> </button>
</div> </div>
</form> </form>
@ -70,11 +70,15 @@ export default {
setStageType: function() { setStageType: function() {
console.log("Setting stage type"); console.log("Setting stage type");
axios axios
.put(this.stageTypeUri, this.stageType) .put(this.stageTypeUri, this.stageType,{
headers: {
'Content-Type': 'text/plain',
}
})
.then(response => { .then(response => {
this.stageType = response.data; this.stageType = response.data;
console.log("Stage type set to " + this.stageType); console.log("Stage type set to " + this.stageType);
this.modalNotify("Stage type changed."); this.modalNotify("Stage geometry changed.");
}) })
.catch(error => { .catch(error => {
this.modalError(error); this.modalError(error);