From f317308d61376748a13a177a4514495c1d21c1e7 Mon Sep 17 00:00:00 2001 From: orion Date: Sat, 28 Oct 2023 01:01:39 +0300 Subject: [PATCH 1/3] Rename broadName --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 2ab9ca2..b66c6c4 100644 --- a/src/index.js +++ b/src/index.js @@ -96,7 +96,7 @@ app.post('/api/login', async (req, res) => { }); app.post('/api/createBoard', async (req, res) => { - const { boardId, boardName } = req.body; + const { boardId, boardTitle } = req.body; let login, token; try { let currentSession = req.session; @@ -112,7 +112,7 @@ app.post('/api/createBoard', async (req, res) => { let queryRes = await db.query('SELECT * FROM boards WHERE board_id = $1::text', [boardId]); if (boardId.length == 0 || boardId.length > 5) return res.status(401).send("Неверный размер URI борды"); - if (boardName.length == 0 || boardName.length > 32) return res.status(401).send("Неверный размер имени борды"); + if (boardTitle.length == 0 || boardTitle.length > 32) return res.status(401).send("Неверный размер имени борды"); if (queryRes.rowCount > 0) return res.status(401).send("Такая борда уже существует."); await db.query('INSERT INTO boards (board_id, board_name) VALUES ($1, $2)', [boardId, boardName]); From c368b83697463af53feeb7e732cb83a71900b923 Mon Sep 17 00:00:00 2001 From: orion Date: Sat, 28 Oct 2023 01:11:17 +0300 Subject: [PATCH 2/3] Rename broadName --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index b66c6c4..d0918ec 100644 --- a/src/index.js +++ b/src/index.js @@ -106,16 +106,16 @@ app.post('/api/createBoard', async (req, res) => { console.log(err); } - if (token != tokens[login] || !token) return res.status(403).send("Невалидный токен"); + // if (token != tokens[login] || !token) return res.status(403).send("Невалидный токен"); - console.log(`Admin ${login} is creating new board: ${boardId}, ${boardName}`); + console.log(`Admin ${login} is creating new board: ${boardId}, ${boardTitle}`); let queryRes = await db.query('SELECT * FROM boards WHERE board_id = $1::text', [boardId]); if (boardId.length == 0 || boardId.length > 5) return res.status(401).send("Неверный размер URI борды"); if (boardTitle.length == 0 || boardTitle.length > 32) return res.status(401).send("Неверный размер имени борды"); if (queryRes.rowCount > 0) return res.status(401).send("Такая борда уже существует."); - await db.query('INSERT INTO boards (board_id, board_name) VALUES ($1, $2)', [boardId, boardName]); + await db.query('INSERT INTO boards (board_id, board_name) VALUES ($1, $2)', [boardId, boardTitle]); return res.status(200).send("Борда успешно создана"); }); From 07598f70d1e636b9ccd150e3b8b1d209b10942d6 Mon Sep 17 00:00:00 2001 From: orion Date: Sat, 28 Oct 2023 10:12:36 +0300 Subject: [PATCH 3/3] Rename container name --- deploy/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index c0fe0a3..fefa834 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -13,7 +13,7 @@ services: - ./postgres:/var/lib/postgresql/data web: - container_name: dachan.fun + container_name: dach_web healthcheck: test: [