summaryrefslogtreecommitdiffstats
path: root/src/services/ChatService.js
blob: 08deba2a00331f7c029b7ec3e13b10b0e8d4f3e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import axios from "axios";
import error_notify from './NotifyErrorService.js'

const url = 'http://localhost:8000/api/chat/'

export default {
    async group_create(data) {
        return await axios
        .post(url+'groups/', data)
        .then(res => {
            return {
                status: res.status
            }
        })
        .catch(error => error_notify(error))
   },

    async get_all_user_groups() {
        return await axios
        .get(url+'groups/')
        .then(res => {
            return {
                status: res.status,
                data: res.data
            }
        })
        .catch(error => error_notify(error))
    }
}