From 5ef43e88b08d1b4e963b6bddb655f27983271ea5 Mon Sep 17 00:00:00 2001 From: Martin Araneda Date: Fri, 10 Feb 2023 22:11:42 -0300 Subject: [PATCH] minor changes password verif --- frontend/src/layout/AppTopbar.vue | 20 +++++++++++++++++++- frontend/src/views/OsCrud.vue | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/src/layout/AppTopbar.vue b/frontend/src/layout/AppTopbar.vue index ac74d0d..5089658 100644 --- a/frontend/src/layout/AppTopbar.vue +++ b/frontend/src/layout/AppTopbar.vue @@ -3,6 +3,7 @@ import { ref, computed, onMounted, onBeforeUnmount } from 'vue'; import { useLayout } from '@/layout/composables/layout'; import { useRouter } from 'vue-router'; import { useToast } from 'primevue/usetoast'; +import axios from 'axios'; const { onMenuToggle } = useLayout(); @@ -47,8 +48,25 @@ onBeforeUnmount(() => { unbindOutsideClickListener(); }); -const onClickPasswordChange = () => { + +async function onClickPasswordChange() { submitted.value = true; + console.log(user.value); + var pass = + + { + password: user.value.current_password, + new_password: user.value.new_password + }; + /* try { + const response = await axios.patch(`http://localhost:3001/user/` + user.value.ID, auth.getTokenHeader()); + if (response.status !== 204) { + console.error(response); + } + } + catch (error) { + console.error(error); + } */ } diff --git a/frontend/src/views/OsCrud.vue b/frontend/src/views/OsCrud.vue index f261cda..abca07a 100644 --- a/frontend/src/views/OsCrud.vue +++ b/frontend/src/views/OsCrud.vue @@ -90,6 +90,7 @@ async function onChangeOS() { { name: os.value.name }; + console.log(os.value.ID); try { const response = await axios.patch(`http://localhost:3001/os/` + os.value.ID, changeOS, auth.getTokenHeader());