{"version":3,"sources":["webpack:///./src/views/account/Account.vue","webpack:///./src/views/account/Account.vue?2b84","webpack:///./src/views/account/Account.vue?43b5","webpack:///./src/core/helpers/breadcrumb.ts"],"names":["class","id","model","currentUser","ref","prop","type","name","placeholder","email","disabled","role","style","password","confirmPassword","submit","formRef","loading","store","getters","errorMessage","value","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","userForm","dispatch","UPDATE_USER","then","router","push","catch","render","setCurrentPageBreadcrumbs","pageTitle","breadcrumbs","SET_BREADCRUMB_ACTION","title","pageBreadcrumbPath","setCurrentPageTitle"],"mappings":"wJACOA,MAAM,sB,GAOJC,GAAG,aAAaD,MAAM,iB,GAOlBA,MAAM,4B,GACJA,MAAM,Y,GAKJA,MAAM,Y,GACJA,MAAM,O,GACJA,MAAM,mB,GAeZA,MAAM,Y,GAKJA,MAAM,mB,GAaRA,MAAM,Y,GAKJA,MAAM,mB,GAcRA,MAAM,Y,GAIFA,MAAM,mB,GAaVA,MAAM,Y,GAIFA,MAAM,mB,GAcZA,MAAM,oD,gIA7GqB,EAAW,a,yBAAjD,gCA+HM,MA/HN,EA+HM,C,cA9HJ,gCAIM,OAJDA,MAAM,uCAAqC,CAC9C,gCAEM,OAFDA,MAAM,kBAAgB,CACzB,gCAAyC,MAArCA,MAAM,iBAAgB,kB,IAI9B,gCAuHM,MAvHN,EAuHM,CAtHJ,yBAqHU,GApHRC,GAAG,kBACHD,MAAM,OACLE,MAAO,EAAAC,YACRC,IAAI,W,8BAEJ,IA6FM,CA7FN,gCA6FM,MA7FN,EA6FM,CA5FJ,gCAoBM,MApBN,EAoBM,C,YAnBJ,gCAEQ,SAFDJ,MAAM,iDAAgD,UAE7D,IAEA,gCAcM,MAdN,EAcM,CAbJ,gCAYM,MAZN,EAYM,CAXJ,gCAUM,MAVN,EAUM,CATJ,yBAQe,GARDK,KAAK,QAAM,C,6BACzB,IAME,C,4BANF,gCAME,SALAC,KAAK,OACLC,KAAK,OACLP,MAAM,+DACNQ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H,KAQXI,EAAuBF,IAClC,OAAMX,SAAS,OAAQU,sBAAuB,CAC5CC,MAAOA","file":"js/chunk-cbba9bbc.eb15e8ac.js","sourcesContent":["\r\n\r\n\r\n","\r\nimport { defineComponent, onMounted, ref, } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.js\";\r\nimport { Actions } from \"@/store/enums/SmsStoreEnums\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport { useStore } from \"vuex\";\r\nimport router from \"@/router\";\r\n\r\nexport default defineComponent({\r\n name: \"my-account\",\r\n setup() {\r\n const formRef = ref(null);\r\n const loading = ref(false);\r\n const confirmPassword = ref('');\r\n const password= ref('');\r\n const store = useStore();\r\n const currentUser = store.getters.currentUser; \r\n\r\n const submit = () => {\r\n let errorMessage = '';\r\n\r\n if(!currentUser.name || !currentUser.email ){\r\n errorMessage = \"Please fill out all required fields\";\r\n }\r\n else if((password.value !== '' || confirmPassword.value !== '') && password.value != confirmPassword.value){\r\n errorMessage = 'password and confirmed password are not matched';\r\n }\r\n\r\n if(errorMessage !== ''){\r\n Swal.fire({\r\n text: errorMessage,\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n\r\n return false;\r\n }\r\n else{\r\n loading.value = true;\r\n let userForm : any = { id: currentUser.id, name: currentUser.name, email : currentUser.email, password : password.value };\r\n store\r\n .dispatch(Actions.UPDATE_USER, userForm)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"Account change successfully submitted!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n }).then(() => {\r\n router.push({ name: \"dashboard\" });\r\n });\r\n \r\n })\r\n .catch(() => {\r\n Swal.fire({\r\n text: \"Update Failed.\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Try again!\",\r\n customClass: {\r\n confirmButton: \"btn fw-bold btn-light-danger\",\r\n },\r\n });\r\n });\r\n\r\n /*\r\n ApiService.setHeader(); \r\n ApiService.put(\"user/\"+currentUser.id, userForm)\r\n .then(()=>{\r\n Swal.fire({\r\n text: \"Account change successfully submitted!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n }).then(() => {\r\n password.value= '';\r\n confirmPassword.value = '';\r\n store.dispatch(Actions.UPDATE_USER, currentUser);\r\n });\r\n })\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('edit account error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to edit account\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n */\r\n }\r\n };\r\n \r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"My Account\",[]);\r\n });\r\n\r\n return {\r\n submit,\r\n formRef,\r\n currentUser,\r\n password,\r\n confirmPassword\r\n };\r\n },\r\n});\r\n","import { render } from \"./Account.vue?vue&type=template&id=419445f2\"\nimport script from \"./Account.vue?vue&type=script&lang=ts\"\nexport * from \"./Account.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","import store from \"@/store\";\r\nimport { Actions } from \"@/store/enums/StoreEnums\";\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} pageTitle Current page title\r\n * @param {Array} breadcrumbs Current page breadcrumbs\r\n */\r\nexport const setCurrentPageBreadcrumbs = (\r\n pageTitle: string,\r\n breadcrumbs: Array\r\n): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: pageTitle,\r\n pageBreadcrumbPath: breadcrumbs,\r\n });\r\n};\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} title Current page title name\r\n */\r\nexport const setCurrentPageTitle = (title: string): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: title,\r\n });\r\n};\r\n"],"sourceRoot":""}