summaryrefslogtreecommitdiffstats
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rw-r--r--src/services/ChatService.js12
-rw-r--r--src/services/CommandsService.js14
2 files changed, 25 insertions, 1 deletions
diff --git a/src/services/ChatService.js b/src/services/ChatService.js
index ab1e6c2..08deba2 100644
--- a/src/services/ChatService.js
+++ b/src/services/ChatService.js
@@ -13,5 +13,17 @@ export default {
13 } 13 }
14 }) 14 })
15 .catch(error => error_notify(error)) 15 .catch(error => error_notify(error))
16 },
17
18 async get_all_user_groups() {
19 return await axios
20 .get(url+'groups/')
21 .then(res => {
22 return {
23 status: res.status,
24 data: res.data
25 }
26 })
27 .catch(error => error_notify(error))
16 } 28 }
17} 29}
diff --git a/src/services/CommandsService.js b/src/services/CommandsService.js
index 01a758e..e21c8f7 100644
--- a/src/services/CommandsService.js
+++ b/src/services/CommandsService.js
@@ -1,11 +1,23 @@
1import AuthService from "./AuthService" 1import AuthService from "./AuthService"
2import ChatService from "./ChatService"
2import store from "@/store/index.js" 3import store from "@/store/index.js"
3import router from '@/router/index.js' 4import router from '@/router/index.js'
4 5
6function set_groups(data) {
7 return {[data.name.replace(" ", "_")]() {console.log(data.name)}}
8}
9
5export default { 10export default {
6 groups() { 11 groups() {
7 return { 12 return {
8 send(searcher) {console.log(searcher)}, 13 async send() {
14 const {data, status} = await ChatService.get_all_user_groups()
15 if (status!==200)
16 return {}
17 const test1 = set_groups(data[0])
18 const test2 = set_groups(data[0])
19 return {test1, test2}
20 },
9 21
10 make(searcher) { 22 make(searcher) {
11 searcher.$emit('toogle_group_maker') 23 searcher.$emit('toogle_group_maker')