UNPKG

chamesu

Version:

This package contains all packages of the chat application.

31 lines (23 loc) 848 B
/* * Copyright (c) 2022. * Author Peter Placzek (tada5hi) * For the full copyright and license information, * view the LICENSE file that was distributed with this source code. */ import {formatRequestRecord, RequestRecord} from "~/modules/api/utils"; import {useApi} from "~/modules/api"; export async function getGroupRoom(roomId: number) { const response = await useApi('auth') .get('/chat/group-rooms/' + roomId); return response.data; } export async function getGroupRooms(record?: RequestRecord) { const {data: response} = await useApi('auth') .get('/chat/group-rooms' + formatRequestRecord(record)); return response; } export async function addGroupRoom(data: Record<string, any>) { const {data: response} = await useApi('auth') .post('/chat/group-rooms', data); return response; }