Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
effy971 committed Nov 8, 2020
1 parent 16f8f34 commit 852be20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions createchatroom.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { MongoClient } = require("mongodb");

module.exports = async function (roomId, roomname) {
module.exports = async function (roomId, roomname, createdBy) {
const uri = process.env.DB_CREDENTIALS;

const client = new MongoClient(uri);
Expand All @@ -13,7 +13,11 @@ module.exports = async function (roomId, roomname) {

// create js obj received by /register

const doc = { roomId: roomId, chatroomName: roomname };
const doc = {
roomId: roomId,
chatroomName: roomname,
createdBy: createdBy,
};
console.log(roomId);
const result = await collection.insertOne(doc);

Expand Down

0 comments on commit 852be20

Please sign in to comment.