feat(channel): Serverweite Channel-Auswahl mit Persistenz und SSE-Broadcast; Frontend passt Auswahl global an
This commit is contained in:
parent
fdf0dea3e6
commit
e83954624c
4 changed files with 111 additions and 14 deletions
|
|
@ -79,6 +79,21 @@ export async function fetchChannels(): Promise<VoiceChannelInfo[]> {
|
|||
return res.json();
|
||||
}
|
||||
|
||||
export async function getSelectedChannels(): Promise<Record<string, string>> {
|
||||
const res = await fetch(`${API_BASE}/selected-channels`);
|
||||
if (!res.ok) throw new Error('Fehler beim Laden der Channel-Auswahl');
|
||||
const data = await res.json();
|
||||
return data?.selected || {};
|
||||
}
|
||||
|
||||
export async function setSelectedChannel(guildId: string, channelId: string): Promise<void> {
|
||||
const res = await fetch(`${API_BASE}/selected-channel`, {
|
||||
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ guildId, channelId })
|
||||
});
|
||||
if (!res.ok) throw new Error('Channel-Auswahl setzen fehlgeschlagen');
|
||||
}
|
||||
|
||||
export async function playSound(soundName: string, guildId: string, channelId: string, volume: number, relativePath?: string): Promise<void> {
|
||||
const res = await fetch(`${API_BASE}/play`, {
|
||||
method: 'POST',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue