From e8fc96e39948d77f756ea32f88d52999e7afcbce Mon Sep 17 00:00:00 2001 From: glen Date: Mon, 8 Nov 2021 21:54:03 +0900 Subject: [PATCH] Fix fix/socket --- server/index.cjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/index.cjs b/server/index.cjs index 46014e93..0d7ec388 100644 --- a/server/index.cjs +++ b/server/index.cjs @@ -17,9 +17,12 @@ const io = new Server(server, { }); io.on("connection", (socket) => { - socket.on("join", (data) => { + socket.on("join", async (data) => { const { roomId } = data; socket.join(roomId); + await db.Chattings.create({ + content: "1", + }); }); socket.on("sendDocData", async (data) => {