visgraph: fix POST response (create link)

This commit is contained in:
Mathieu Jaumotte 2021-11-03 14:54:27 +01:00
parent 4d08f3583e
commit e7900b8b21

View File

@ -111,6 +111,7 @@ import { mapState, mapGetters } from "vuex"
import Modal from 'ChillMainAssets/vuejs/_components/Modal'
import VueMultiselect from 'vue-multiselect'
import { getRelationsList, postRelationship } from "./api";
import { adapt2vis } from "./vis-network";
export default {
name: "App",
@ -309,9 +310,10 @@ export default {
return postRelationship(
this.getPerson(this.modal.data.from), this.getPerson(this.modal.data.to), this.relation, this.reverse
)
.then(response => new Promise(resolve => {
console.log('', response)
modal.showModal = false
.then(relationship => new Promise(resolve => {
console.log('post response', relationship)
this.$store.dispatch('addLinkFromRelationship', adapt2vis(relationship))
this.modal.showModal = false
this.resetForm()
resolve()
}))