import{a as r,i as t}from"./_plugin-vue_export-helper-D7RxQbao.js";import{R as o}from"./ResourceCard-CnK6HGOe.js";import"./SimpleIcon-DmQBL0yh.js";import"./file-text-Cg1_0lFN.js";import"./circle-alert-WEXLyz5z.js";let a=r({components:{ResourceCard:o},data(){return{error:null,success:!1,loading:!1,passwordData:{newUsername:"sunshine",newPassword:"",confirmNewPassword:""}}},methods:{save(){this.error=null,this.loading=!0,fetch("./api/password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.passwordData)}).then(s=>{this.loading=!1,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(a);
