Only stringify boolean values when setting properties
My workaround to the axios bug that makes `false` values not work
This commit is contained in:
parent
ba86c37292
commit
d96dbdd546
1 changed files with 7 additions and 3 deletions
|
|
@ -63,9 +63,13 @@ Vue.mixin({
|
||||||
"writeproperty",
|
"writeproperty",
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
// NB stringify is needed below, because otherwise boolean
|
// `false` fails because axios somehow eats it!
|
||||||
// values get missed.
|
// Other values should not be stringified or pydantic
|
||||||
await axios.put(url, JSON.stringify(value));
|
// can't parse them.
|
||||||
|
if (value===false | value===true) {
|
||||||
|
value=JSON.stringify(value);
|
||||||
|
}
|
||||||
|
await axios.put(url, value);
|
||||||
},
|
},
|
||||||
thingActionUrl(thing, action) {
|
thingActionUrl(thing, action) {
|
||||||
let url = this.$store.getters["wot/thingActionUrl"](
|
let url = this.$store.getters["wot/thingActionUrl"](
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue