no moulinette ?
This commit is contained in:
parent
a0b5e97058
commit
2b7b6b8684
5 changed files with 50 additions and 16 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue