diff --git a/client/src/main.tsx b/client/src/main.tsx index a4df633..6024566 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -27,7 +27,6 @@ function App() } /> } /> } /> - } /> } /> } /> diff --git a/server/src/routers/chats.ts b/server/src/routers/chats.ts index 106376c..5ee38d9 100644 --- a/server/src/routers/chats.ts +++ b/server/src/routers/chats.ts @@ -34,6 +34,8 @@ chats.get("/", async (_req, res: Response) => { chats.get("/:id", async (req, res: Response) => { let chat; + console.log(req.params.id); + if (!res.locals.user.matches.map(m => m.chat_id).includes(req.params.id) || (chat = await collection.findOne({ "id": req.params.id })) === null) { res.status(404).send("Chat not found"); return; diff --git a/server/src/routers/profile.ts b/server/src/routers/profile.ts index 086da75..16ae514 100644 --- a/server/src/routers/profile.ts +++ b/server/src/routers/profile.ts @@ -14,7 +14,7 @@ profile.get("/me", (_req, res: Response<{}, { user: UserData }>) => { profile.post("/me", async (req: Request<{}, {}, Partial<{ bio: string, open_to_wave: boolean }>>, res: Response<{}, { user: UserData }>) => { let { bio, open_to_wave } = req.body; const user = res.locals.user; - await users.updateOne({ firebase_id: user.firebase_id }, { "$set": { bio: (bio || user.bio), open_to_wave: (open_to_wave || user.open_to_wave) } }); + await users.updateOne({ firebase_id: user.firebase_id }, { "$set": { bio: (bio || user.bio), open_to_wave: (open_to_wave !== null ? open_to_wave : user.open_to_wave) } }); res.json({ ...user, bio, open_to_wave }); });