fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { createStore } from 'vuex';
|
||||
import {
|
||||
ADMIN_GET_SITE_SETTING,
|
||||
ADMIN_LOGIN_DETAIL,
|
||||
APPOINTMENT_DETAILS_API,
|
||||
LABS_DELETE_API,
|
||||
@@ -38,7 +39,8 @@ export default createStore({
|
||||
patientNotes: null,
|
||||
medicineList: [],
|
||||
questioneriesList: [],
|
||||
adminDetail:null
|
||||
adminDetail: null,
|
||||
sitSetting:null
|
||||
},
|
||||
mutations: {
|
||||
setLoading(state, payload) {
|
||||
@@ -77,8 +79,10 @@ export default createStore({
|
||||
},
|
||||
setAdminDetail(state, payload) {
|
||||
state.adminDetail = payload
|
||||
},
|
||||
setSiteSetting(state, payload) {
|
||||
state.sitSetting = payload
|
||||
}
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
@@ -561,6 +565,24 @@ export default createStore({
|
||||
console.error('Error:', error);
|
||||
});
|
||||
},
|
||||
async siteSetting({ commit }, payload) {
|
||||
commit('setLoading', true)
|
||||
|
||||
await axios.post(ADMIN_GET_SITE_SETTING, {}, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('admin_access_token')}`,
|
||||
}
|
||||
}) .then(response => {
|
||||
commit('setLoading', false)
|
||||
console.log('Response:', response.data);
|
||||
commit('setSiteSetting',response.data.medicines)
|
||||
|
||||
})
|
||||
.catch(error => {
|
||||
commit('setLoading', false)
|
||||
console.error('Error:', error);
|
||||
});
|
||||
},
|
||||
},
|
||||
getters: {
|
||||
getIsLoading(state){
|
||||
@@ -600,5 +622,8 @@ export default createStore({
|
||||
getAdminDetail(state){
|
||||
return state.adminDetail
|
||||
},
|
||||
getSiteSetting(state){
|
||||
return state.siteSetting
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user