From 52e4eb81330d97c59e47fa07bd79cb676b04f085 Mon Sep 17 00:00:00 2001 From: =bhagwanSingh Date: Mon, 24 Nov 2025 13:43:23 +0530 Subject: [PATCH] s --- public/css/dashboard.css | 2 +- src/helper/updateEntityRelationships.js | 4 ++-- src/server.js | 19 ++++--------------- views/client/dashboard-dashboard.ejs | 18 +++++++++--------- views/client_login.ejs | 10 +++++++--- views/va_client_register.ejs | 2 +- views/va_register.ejs | 2 +- 7 files changed, 25 insertions(+), 32 deletions(-) diff --git a/public/css/dashboard.css b/public/css/dashboard.css index 4bfd24f..f1bf39d 100644 --- a/public/css/dashboard.css +++ b/public/css/dashboard.css @@ -80,7 +80,7 @@ body { padding: 0 1.5rem; gap: 1rem; width: 100%; - max-width: 1024px; + /* max-width: 1024px; */ flex-direction: row; align-items: center; justify-content: space-between; diff --git a/src/helper/updateEntityRelationships.js b/src/helper/updateEntityRelationships.js index a689f87..060ce63 100644 --- a/src/helper/updateEntityRelationships.js +++ b/src/helper/updateEntityRelationships.js @@ -212,7 +212,7 @@ async function removeEntityRelationships(data) { }} ); } - + // Remove projectId from VAs if (vaId && Array.isArray(vaId)) { await VAModel.updateMany( @@ -220,7 +220,7 @@ async function removeEntityRelationships(data) { { $pull: { projectIds: projectId, // 🐞🐞🐞 Here before removing we need to check if VA is still assigned to other projects of the same client - clientIds: clientId + clientIds: clientId }} ); } diff --git a/src/server.js b/src/server.js index 17cc29a..5e7972b 100644 --- a/src/server.js +++ b/src/server.js @@ -26,19 +26,6 @@ const app = express(); const server = new createServer(app); const io = new Server(server); -app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { - console.log("⚠️ Certificate error:", url); - - // Allow for ngrok only - if (url.includes("ngrok")) { - event.preventDefault(); - callback(true); // approve the certificate - } else { - callback(false); // reject others - } -}); - - app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { console.log("⚠️ Certificate error:", url); @@ -93,7 +80,8 @@ app.get('/varegister/:sf_token?', (req, res) => { const decoded = jwt.verify(sf_token, process.env.JWT_SECRET_SF_TOKEN); if (decoded) { - res.render('va_register', { title: "VA Registration" }); + const email = decoded.email; + res.render('va_register', { title: "VA Registration", email }); } else { res.render('not_found', { title: "VA Registration" }); } @@ -114,7 +102,8 @@ app.get('/clientregister/:sf_token?', (req, res) => { const decoded = jwt.verify(sf_token, process.env.JWT_SECRET_SF_TOKEN); if (decoded) { - res.render('va_client_register', { title: "Client Registration" }); + const email = decoded.email; + res.render('va_client_register', { title: "Client Registration", email }); } else { res.render('not_found', { title: "Client Registration" }); } diff --git a/views/client/dashboard-dashboard.ejs b/views/client/dashboard-dashboard.ejs index 091dc6b..12481a8 100644 --- a/views/client/dashboard-dashboard.ejs +++ b/views/client/dashboard-dashboard.ejs @@ -256,7 +256,7 @@
-
${va.firstName} ${va.lastName}
+
${va.name}
${va.email || 'N/A'}
@@ -304,14 +304,14 @@ vaEmptyState.style.display = 'none'; // Add event listeners to view links - document.querySelectorAll('.view-link').forEach(link => { - link.addEventListener('click', function(e) { - e.preventDefault(); - const vaId = this.getAttribute('data-va-id'); - // You can update this link as needed - window.location.href = `/client/virtual-assistants/${vaId}`; - }); - }); + // document.querySelectorAll('.view-link').forEach(link => { + // link.addEventListener('click', function(e) { + // e.preventDefault(); + // const vaId = this.getAttribute('data-va-id'); + // // You can update this link as needed + // window.location.href = `/client/virtual-assistants/${vaId}`; + // }); + // }); } else { vaTableBody.innerHTML = ''; vaTableBody.style.display = 'none'; diff --git a/views/client_login.ejs b/views/client_login.ejs index 4b9e36f..f0587f8 100644 --- a/views/client_login.ejs +++ b/views/client_login.ejs @@ -213,7 +213,7 @@
@@ -224,7 +224,7 @@ Forgot password? - +