Skip to content
Snippets Groups Projects
Commit d190acb3 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Fix ForeignKeyField not returning object when attribute is set and new object is created

parent 166bddf7
No related branches found
No related tags found
1 merge request!1261Manage holidays
Pipeline #136863 canceled
......@@ -109,12 +109,13 @@ export default {
handleSave(data) {
let newItem =
data.data[this.gqlCreateMutation.definitions[0].name.value].item;
let newValue = this.$attrs["return-object"] ? newItem : newItem.id;
let modelValue = this.$attrs.hasOwnProperty("multiple")
? Array.isArray(this.$attrs.value)
? this.$attrs.value.concat(newValue)
: [newValue]
: newValue;
let newValue = "return-object" in this.$attrs ? newItem : newItem.id;
let modelValue =
"multiple" in this.$attrs
? Array.isArray(this.$attrs.value)
? this.$attrs.value.concat(newValue)
: [newValue]
: newValue;
this.$emit("input", modelValue);
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment