no moulinette ?

This commit is contained in:
Guillem George 2026-05-16 11:14:39 +02:00
parent a0b5e97058
commit 2b7b6b8684
5 changed files with 50 additions and 16 deletions

View file

@ -1,3 +1,4 @@
import { authedAPIRequest } from "../utils/auth";
// FIXME: This file should handle the rooms API
// Functions may include:
// - fetchRoomConfig (get the configuration of a room)
@ -24,3 +25,22 @@
// // leave the room
// socket.leave('some room');
// });
//
async function fetchRoomConfig(room) {
const response = await authedAPIRequest("/rooms/" + room + "/config");
if (!response.ok) {
console.error("Could not retrieve room config: " + response.statusText);
console.debug(await response.text());
return;
}
const obj = await response.json();
console.debug(`Retrieved config for room ${room}: ${obj}`);
// Update HTML
}
export { fetchRoomConfig };