This commit is contained in:
nasir@endelospay.com 2024-06-06 05:49:15 +05:00
parent 680b2b1164
commit c7fa12f28b
2 changed files with 47 additions and 3 deletions

View File

@ -28,6 +28,18 @@ const configStore = useConfigStore()
>
<VProgressCircular indeterminate />
</VOverlay>
<VSnackbar v-model="store.getters.getSuccessMsg" :timeout="5000" location="top end" variant="flat"
color="success">
<VIcon
class="ri-success-line success-icon"
/> {{ store.getters.getShowMsg }}
</VSnackbar>
<VSnackbar v-model="store.getters.getErrorMsg" :timeout="5000" location="top end" variant="flat"
color="error">
<VIcon
class="ri-success-line success-icon"
/> {{ store.getters.getShowMsg }}
</VSnackbar>
<VLocaleProvider :rtl="configStore.isAppRTL">
<!-- This is required to set the background color of active nav link based on currently active global theme's primary -->
<VApp :style="`--v-global-theme-primary: ${hexToRgb(global.current.value.colors.primary)}`">

View File

@ -32,6 +32,8 @@ import {
export default createStore({
state: {
isLoading: false,
isErrorMsg: false,
isSuccessMsg: false,
patientList:[],
patientMeetingList: [],
providerMeetingList:[],
@ -43,13 +45,26 @@ export default createStore({
medicineList: [],
questioneriesList: [],
adminDetail: null,
siteSetting:null
siteSetting: null,
showMessage:null
},
mutations: {
setLoading(state, payload) {
console.log('payload');
state.isLoading = payload
},
setErrorMsg(state, payload) {
console.log('payload');
state.isErrorMsg = payload
},
setSuccessMsg(state, payload) {
console.log('payload');
state.isSuccessMsg = payload
},
setShowMsg(state, payload) {
console.log('payload');
state.showMessage = payload
},
setPtientList(state, payload) {
state.patientList = payload
},
@ -605,7 +620,7 @@ export default createStore({
}) .then(response => {
commit('setLoading', false)
console.log('Response:', response.data);
})
.catch(error => {
commit('setLoading', false)
@ -626,7 +641,12 @@ export default createStore({
}) .then(response => {
commit('setLoading', false)
console.log('Response:', response.data);
if (response.data.status == 'error') {
commit('setErrorMsg', true)
console.log('Response:', response.data.msg);
commit('setShowMsg', response.data.msg)
}
})
.catch(error => {
commit('setLoading', false)
@ -659,6 +679,18 @@ export default createStore({
getters: {
getIsLoading(state){
return state.isLoading
},
getErrorMsg(state) {
console.log('payload');
return state.isErrorMsg
},
getSuccessMsg(state) {
console.log('payload');
return state.isSuccessMsg
},
getShowMsg(state) {
console.log('payload');
return state.showMessage
},
getPatientList(state){
return state.patientList