{"version":3,"sources":["webpack:///./src/store/modules/advisor-online-schedule/state/index.js","webpack:///./src/store/modules/advisor-online-schedule/getters/index.js","webpack:///./src/store/modules/advisor-online-schedule/mutations/index.js","webpack:///./src/store/modules/advisor-online-schedule/actions/index.js","webpack:///./src/store/modules/advisor-online-schedule/index.js","webpack:///./src/store/modules/chat/getters/index.js","webpack:///./src/store/modules/chat/actions/index.js"],"names":["processing","error","success","blankGetters","clearError","state","payload","generic","setError","setSuccess","setProcessing","getAdvisorOnlineSchedules","context","commit","apolloClient","query","GET_ADVISOR_ONLINE_SCHEDULES","fetchPolicy","clientName","result","data","errors","getAdvisorOnlineSchedulesByFilter","GET_ADVISOR_ONLINE_SCHEDULES_BY_FILTER","variables","getAdvisorOnlineSchedulesByFilterForTable","GET_ADVISOR_ONLINE_SCHEDULES_BY_FILTER_FOR_TABLE","getAdvisorOnlineSchedulesCurrentUser","GET_ADVISOR_ONLINE_SCHEDULES_CURRENT_USER","graphQLErrors","length","serverResponseStatusSet","extensions","getAdvisorOnlineSchedule","GET_ADVISOR_ONLINE_SCHEDULE","addAdvisorOnlineSchedule","mutate","mutation","ADD_ADVISOR_ONLINE_SCHEDULE","newItemSuccess","topicLocal","updateAdvisorOnlineSchedule","UPDATE_ADVISOR_ONLINE_SCHEDULE","updateItemSuccess","deleteAdvisorOnlineSchedule","DELETE_ADVISOR_ONLINE_SCHEDULE","deleteItemSuccess","namespaced","getters","getField","mutations","updateField","actions","getChatrooms","classrooms","GET_CHATROOMS","chatrooms","getChatRooms","status","message","console","log","full","getChatroomsByFilter","GET_CHATROOMS_BY_FILTER","getChatroomById","id","Error","GET_CHATROOM_BY_ID","chatroom","getChatRoomById","getChatroomByAssociativeKey","GET_CHATROOM_BY_ASSOCIATIVE_KEY","getChatRoomByAssociativeKey","sendChatMessages","SEND_CHATMESSAGES","chatMessageSentResult"],"mappings":"q8BAAe,GACbA,YAAY,EACZC,MAAO,KACPC,QAAS,MCHJ,SAASC,K,gBCET,SAASC,EAAW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R,MAvBG,kBAyBI,CAAEH,OAAQ,CAAExD,SAAS,EAAOD,OAAO,EAAM0D,QAAS,GAAIG,KAAM,EAAF,MAzB9D,0D,wBAsCA,SAAeY,EAAtB,oC,8DAAO,WAAgC9D,EAASN,GAAzC,sGACGO,EAAWD,EAAXC,OACRA,EAAO,iBAAiB,GAGlBW,EAAYlB,EALb,kBAQkBQ,OACpBsB,OAAO,CACNC,SAAUsC,OACVnD,YACAZ,QAAS,CAAEM,WAAY,aAZtB,cAQGC,EARH,OAeKC,EAASD,EAATC,KAEFwD,EAAwBxD,EAAKsD,iBAjBhC,kBAoBI,CAAEhB,OAAQ,CAAExD,SAAS,EAAMD,OAAO,EAAO0D,QAAS,IAAMvC,KAAMwD,IApBlE,4CAuBHhB,QAAQC,IAAR,MAvBG,kBAyBI,CAAEH,OAAQ,CAAExD,SAAS,EAAOD,OAAO,EAAM0D,QAAS,GAAIG,KAAM,EAAF,MAzB9D,0D","file":"js/app~ec673aab.d09ae0d1.js","sourcesContent":["export default {\n processing: false,\n error: null,\n success: null,\n}\n\n\n\n","export function blankGetters() {\n return;\n}\n","import * as generic from \"@/store/generic/mutations/result-status.js\";\n\nexport function clearError(state, payload) {\n generic.clearError(state, payload);\n}\n\nexport function setError(state, payload) {\n generic.setError(state, payload);\n}\n\nexport function setSuccess(state, payload) {\n generic.setSuccess(state, payload);\n}\n\nexport function setProcessing(state, payload) {\n generic.setProcessing(state, payload);\n}\n","import {apolloClient} from '@/setup/apollo-setup';\nimport {\n error,\n newItemSuccess,\n updateItemSuccess,\n deleteItemSuccess,\n serverResponseStatusSet\n} from '@/utils/notification';\nimport {\n GET_ADVISOR_ONLINE_SCHEDULE,\n GET_ADVISOR_ONLINE_SCHEDULES,\n GET_ADVISOR_ONLINE_SCHEDULES_BY_FILTER,\n GET_ADVISOR_ONLINE_SCHEDULES_BY_FILTER_FOR_TABLE,\n GET_ADVISOR_ONLINE_SCHEDULES_CURRENT_USER,\n ADD_ADVISOR_ONLINE_SCHEDULE,\n UPDATE_ADVISOR_ONLINE_SCHEDULE,\n DELETE_ADVISOR_ONLINE_SCHEDULE,\n} from '@/queries/modules/advisor-online-schedule/advisor-online-schedule';\n\nexport async function getAdvisorOnlineSchedules(context) {\n\n context.commit('setProcessing', true);\n try {\n const result = await apolloClient\n .query({\n query: GET_ADVISOR_ONLINE_SCHEDULES,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n });\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return [];\n } else {\n context.commit('setSuccess', null);\n return data.getAdvisorOnlineSchedules\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return [];\n }\n}\n\nexport async function getAdvisorOnlineSchedulesByFilter(context, payload) {\n context.commit('setProcessing', true);\n try {\n const result = await apolloClient\n .query({\n query: GET_ADVISOR_ONLINE_SCHEDULES_BY_FILTER,\n variables: payload,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n });\n\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return [];\n } else {\n context.commit('setSuccess', null);\n\n return data.getAdvisorOnlineSchedulesByFilter;\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return [];\n }\n}\n\nexport async function getAdvisorOnlineSchedulesByFilterForTable(context, payload) {\n context.commit('setProcessing', true);\n try {\n const result = await apolloClient\n .query({\n query: GET_ADVISOR_ONLINE_SCHEDULES_BY_FILTER_FOR_TABLE,\n variables: payload,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n });\n\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return [];\n } else {\n context.commit('setSuccess', null);\n\n return data.getAdvisorOnlineSchedulesByFilter;\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return [];\n }\n}\n\nexport async function getAdvisorOnlineSchedulesCurrentUser(context) {\n const {commit} = context;\n commit('setProcessing', true);\n\n try {\n const result = await apolloClient\n .query({\n query: GET_ADVISOR_ONLINE_SCHEDULES_CURRENT_USER,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n })\n const {data, error} = await result;\n commit('setProcessing', false);\n\n if (error) {\n commit('setError', error);\n return null;\n }\n\n return data.getAdvisorOnlineSchedulesCurrentUser;\n\n } catch (e) {\n commit('setProcessing', false);\n if (e.graphQLErrors && e.graphQLErrors.length > 0) {\n commit('setError', serverResponseStatusSet(e.graphQLErrors[0].extensions));\n }\n return null;\n }\n}\n\nexport async function getAdvisorOnlineSchedule(context, payload) {\n context.commit('setProcessing', true);\n try {\n const result = await apolloClient\n .query({\n query: GET_ADVISOR_ONLINE_SCHEDULE,\n variables: payload,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n });\n\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return null;\n } else {\n context.commit('setSuccess', null);\n return data.getAdvisorOnlineSchedule\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return null;\n }\n}\n\nexport async function addAdvisorOnlineSchedule(context, payload) {\n context.commit('setProcessing', true);\n try {\n const result = await apolloClient\n .mutate({\n mutation: ADD_ADVISOR_ONLINE_SCHEDULE,\n variables: payload,\n context: { clientName: 'Prisma2' }\n });\n\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return null;\n } else {\n context.commit('setSuccess', newItemSuccess(data.addAdvisorOnlineSchedule.topicLocal));\n\n return data.addAdvisorOnlineSchedule;\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return null;\n }\n}\n\nexport async function updateAdvisorOnlineSchedule(context, payload) {\n context.commit('setProcessing', true);\n try {\n const result = await apolloClient\n .mutate({\n mutation: UPDATE_ADVISOR_ONLINE_SCHEDULE,\n variables: payload,\n context: { clientName: 'Prisma2' }\n });\n\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return null;\n } else {\n\n context.commit('setSuccess', updateItemSuccess(data.updateAdvisorOnlineSchedule.topicLocal));\n\n return data.updateAdvisorOnlineSchedule\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return null;\n }\n}\n\nexport async function deleteAdvisorOnlineSchedule(context, payload) {\n context.commit('setProcessing', true);\n\n try {\n const result = await apolloClient\n .mutate({\n mutation: DELETE_ADVISOR_ONLINE_SCHEDULE,\n variables: payload,\n context: { clientName: 'Prisma2' }\n });\n\n const {data, errors} = await result;\n\n if (errors) {\n context.commit('setError', error(errors));\n return null;\n } else {\n context.commit('setSuccess', deleteItemSuccess(data.deleteAdvisorOnlineSchedule.topicLocal));\n\n return data.deleteAdvisorOnlineSchedule\n }\n\n } catch (e) {\n context.commit('setError', error(e));\n return null;\n }\n}\n\n","import state from \"./state\";\nimport * as getters from \"./getters\";\nimport * as mutations from \"./mutations\";\nimport * as actions from \"./actions\";\nimport {getField, updateField} from \"vuex-map-fields\";\n\nexport default {\n namespaced: true,\n getters: {\n getField,\n ...getters,\n },\n mutations: {\n updateField,\n ...mutations,\n },\n actions,\n state\n};\n\n","export function getChatrooms(state) {\n return state.classrooms;\n}\n","/* eslint-disable no-console, no-case-declarations, no-unused-vars */\n// import axios from \"axios\";\nimport { apolloClient } from \"@/setup/apollo-setup\";\n// import { serverResponseStatusSet, error } from '@/utils/notification';\n\nimport {\n GET_CHATROOMS,\n GET_CHATROOMS_BY_FILTER,\n GET_CHATROOM_BY_ID,\n GET_CHATROOM_BY_ASSOCIATIVE_KEY,\n SEND_CHATMESSAGES,\n} from '@/queries/modules/chat/chat.js';\n\n/**\n * Action to Get All Chatroom List\n * ** Use it for development purpose only **\n *\n * @param {Object} context Vuex context object.\n * @property {Vuex method (Function)} commit : \"To commit a mutation\"\n *\n */\n\nexport async function getChatrooms(context) {\n // WIP\n const { commit } = context;\n commit('setProcessing', true);\n\n try {\n const result = await apolloClient\n .query({\n query: GET_CHATROOMS,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n })\n\n const { data } = await result;\n\n const chatrooms = data.getChatRooms;\n commit(\"storeChatrooms\", chatrooms)\n\n return { status: { success: true, error: false, message: \"\" }, data: chatrooms };\n\n } catch (e) {\n console.log(e);\n // commit('setError', serverResponseStatusSet(e));\n return { status: { success: false, error: true, message: \"\", full: e }};\n }\n}\n\n\n/**\n * Action to Get All Chatroom List by Filter (Reduce total chatroom to necessary amount)\n *\n * @param {Object} context Vuex context object.\n * @property {Vuex method (Function)} commit : \"To commit a mutation\"\n *\n */\n\nexport async function getChatroomsByFilter(context) {\n // WIP\n const { commit } = context;\n commit('setProcessing', true);\n\n try {\n const result = await apolloClient\n .query({\n query: GET_CHATROOMS_BY_FILTER,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n })\n\n const { data } = await result;\n\n const chatrooms = data.getChatRooms;\n commit(\"storeChatrooms\", chatrooms)\n\n return { status: { success: true, error: false, message: \"\" }, data: chatrooms };\n\n } catch (e) {\n console.log(e);\n // commit('setError', serverResponseStatusSet(e));\n return { status: { success: false, error: true, message: \"\", full: e }};\n }\n}\n\n\n/**\n * Action to Get Chatroom By Id\n *\n * @param {Object} context Vuex context object.\n * @property {Vuex method (Function)} commit : \"To commit a mutation\"\n *\n */\n\nexport async function getChatroomById(context, { id }) {\n // WIP\n const { commit } = context;\n commit('setProcessing', true);\n\n try {\n if (!id) throw new Error(\"No Chatroom Id\");\n\n const variables = {\n id\n }\n\n console.log(id);\n\n const result = await apolloClient\n .query({\n query: GET_CHATROOM_BY_ID,\n variables,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n })\n\n const { data } = await result;\n\n const chatroom = data.getChatRoomById;\n // TODO: Update Chatroom to Store and Cache;\n\n return { status: { success: true, error: false, message: \"\" }, data: chatroom };\n\n } catch (e) {\n console.log(e);\n // commit('setError', serverResponseStatusSet(e));\n return { status: { success: false, error: true, message: \"\", full: e }};\n }\n}\n\n\n/**\n * Action to Get Chatroom By Associative Key (Feature name and its ID)\n *\n * @param {Object} context Vuex context object.\n * @property {Vuex method (Function)} commit : \"To commit a mutation\"\n *\n */\n\nexport async function getChatroomByAssociativeKey(context, payload) {\n // WIP\n const { commit } = context;\n commit('setProcessing', true);\n\n const variables = payload;\n\n try {\n const result = await apolloClient\n .query({\n query: GET_CHATROOM_BY_ASSOCIATIVE_KEY,\n variables,\n fetchPolicy: 'network-only',\n context: { clientName: 'Prisma2' }\n });\n\n const { data } = result;\n\n const chatroom = data.getChatRoomByAssociativeKey;\n\n return { status: { success: true, error: false, message: \"\" }, data: chatroom };\n\n } catch (e) {\n console.log(e);\n // commit('setError', serverResponseStatusSet(e));\n return { status: { success: false, error: true, message: \"\", full: e }};\n }\n}\n\n\n/**\n * Action to Send Chat Message\n *\n * @param {Object} context Vuex context object.\n * @property {Vuex method (Function)} commit : \"To commit a mutation\"\n *\n */\n\nexport async function sendChatMessages(context, payload) {\n const { commit } = context;\n commit('setProcessing', true);\n\n // const { chatroomId, chatMessagesInput } = payload;\n const variables = payload;\n\n try {\n const result = await apolloClient\n .mutate({\n mutation: SEND_CHATMESSAGES,\n variables,\n context: { clientName: 'Prisma2' }\n });\n\n const { data } = result;\n\n const chatMessageSentResult = data.sendChatMessages;\n // commit(\"storeChatrooms\", chatrooms)\n\n return { status: { success: true, error: false, message: \"\" }, data: chatMessageSentResult };\n\n } catch (e) {\n console.log(e);\n // commit('setError', serverResponseStatusSet(e));\n return { status: { success: false, error: true, message: \"\", full: e }};\n }\n}\n"],"sourceRoot":""}