improve ergonomy
This commit is contained in:
@@ -8,8 +8,12 @@ const chatController = {
|
||||
if (!pubkey) {
|
||||
return res.status(400).json({ error: "Missing publicKey" });
|
||||
}
|
||||
await database.createRoom(req.session.publicKey, stringutils.pemToHex(pubkey));
|
||||
return res.status(201).json({ message: "Room created successfully." });
|
||||
const hexKey = stringutils.pemToHex(pubkey)
|
||||
const roomid = await database.createRoom(req.session.publicKey, hexKey);
|
||||
return res.status(201).json({ message: "Room created successfully.",
|
||||
roomid: roomid,
|
||||
peer: hexKey
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error creating the room:", error);
|
||||
return res.status(500).json({ error: "Failed to create the room" });
|
||||
|
||||
Reference in New Issue
Block a user