import{c as r,i as t}from"./_plugin-vue_export-helper-fP7Bc2kv.js";import{N as a}from"./Navbar-Bk41hp-r.js";const o=r({components:{Navbar:a},data(){return{error:null,success:!1,passwordData:{currentUsername:"",currentPassword:"",newUsername:"",newPassword:"",confirmNewPassword:""}}},methods:{save(){this.error=null,fetch("./api/password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.passwordData)}).then(s=>{s.status===200?s.json().then(e=>{this.success=e.status,this.success===!0?setTimeout(()=>{document.location.reload()},5e3):this.error=e.error}):this.error="Internal Server Error"})}}});t(o);
