Skip to content
Snippets Groups Projects
Commit ab0092cd authored by moon's avatar moon
Browse files

Automatic close the opened editor panel

parent 19bd0599
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@
</button>
</div>
</base-toaster>
<fetch-profile v-if="userData !== null">
<fetch-profile v-if="userData !== null" :key="updatedKey">
<template slot-scope="{ response, loading }">
<slot
:response="response"
......@@ -169,8 +169,7 @@
</div>
<div class="col-sm-9">
<div>
<span v-for="items in response.scientific_discipline " :key="items">{{items}} , </span>
{{response.scientific_discipline.join(', ')}}
</div>
</div>
</div>
......@@ -318,7 +317,7 @@
</div>
<div class="col-sm-9 p-4">
<input
id="inline-profile-link"
id="inline-password"
v-model.trim="password"
class="
bg-white
......@@ -466,6 +465,7 @@ export default {
profileLinkErrMsg: "",
passwordErrMsg: "",
errorMsg: "",
updatedKey: 0,
};
},
computed: {
......@@ -532,7 +532,6 @@ export default {
this.toasterIsOpen = false;
},
showEditMode() {
console.log(true);
this.editMode = true;
},
setRole(roleName) {
......@@ -543,7 +542,7 @@ export default {
return roleName;
},
async update(e) {
console.log("user data", e);
// console.log("user data", e);
const vm = this;
if (vm.isDev) {
......@@ -565,7 +564,6 @@ export default {
}
dat = {
id: vm.user,
scientific_discipline: vm.selected,
};
} else if (this.showEditProfileLink) {
......@@ -576,7 +574,6 @@ export default {
}
dat = {
id: vm.user,
profile_link: vm.profile_link,
};
} else if (this.showChangePassword) {
......@@ -587,7 +584,6 @@ export default {
}
dat = {
id: vm.user,
password: vm.password,
};
}
......@@ -601,7 +597,7 @@ export default {
// scientific_discipline: vm.selected,
// password: vm.password,
// };
console.log(dat);
// console.log(dat);
try {
const res = await this.axios.put(`${host}/api/users/${vm.user}`, dat, {
......@@ -610,12 +606,18 @@ export default {
},
});
console.log(res.data);
// console.log(res.data);
this.error = false;
this.toasterIsOpen = true;
this.editMode = false;
this.isOpen = false;
setTimeout(() => {
this.toasterIsOpen =false;
}, 2000);
this.selected = [];
this.profile_link = "";
this.password = "";
this.updatedKey += 1;
} catch (error) {
// console.log(error.response.data.error.message)
// console.log(error.response)
......
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