1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00
Files
go-discord-bot/client/app/services/sound.service.ts

18 lines
447 B
TypeScript

import { SoundType } from '../components/sound-list/sound-list';
import { ISound } from '../model';
import { axios } from './axios.service';
const playSound = (sound: SoundType): Promise<any> => {
return axios.post('/api/sound/play', { name: sound.name });
};
const getSounds = async (): Promise<ISound[]> => {
const res = await axios.get('/api/sound');
return res.data.data;
};
export const SoundService = {
getSounds,
playSound,
};