Compare commits
7 Commits
68a248c25a
...
4d1abaf9aa
| Author | SHA1 | Date |
|---|---|---|
|
|
4d1abaf9aa | |
|
|
0c14e26937 | |
|
|
221e867a21 | |
|
|
39f415b685 | |
|
|
d4cdc94bbd | |
|
|
99d60185a9 | |
|
|
da3deac57b |
|
|
@ -567,7 +567,7 @@ async function validateStep(step) {
|
|||
// Validate other required fields
|
||||
const requiredFields = form.querySelectorAll('[required]');
|
||||
requiredFields.forEach(field => {
|
||||
if (!field.value.trim()) {
|
||||
if (field.id !== 'email' && !field.value.trim()) {
|
||||
isValid = false;
|
||||
field.classList.add('field-error');
|
||||
} else if (field.id !== 'email') {
|
||||
|
|
@ -902,7 +902,7 @@ async function detectLocation() {
|
|||
await populateStates(countryCode, 'state');
|
||||
await populateStates(countryCode, 'billing-state');
|
||||
|
||||
// // auto populate state if region matches
|
||||
// auto populate state if region matches
|
||||
// const stateSelect = document.getElementById('state');
|
||||
// const billingStateSelect = document.getElementById('billing-state');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import mongoose from "mongoose";
|
||||
import { LoggedModel, WorkTrackModel, ProjectModel, VAModel } from "../../../models/vaModel.js";
|
||||
import authFetch from "../../../utils/authFetch.js";
|
||||
import getDayNumber from "../../../utils/getDayNumber.js";
|
||||
|
|
@ -296,7 +297,7 @@ async function va_project_log_callback(req, res) {
|
|||
const { logId } = payload;
|
||||
|
||||
const workTrackData = await WorkTrackModel.find({
|
||||
logId: logId
|
||||
logId: new mongoose.Types.ObjectId(logId)
|
||||
});
|
||||
|
||||
// console.log(`Found work track data for logout:`, workTrackData);
|
||||
|
|
|
|||
|
|
@ -595,6 +595,24 @@ app.post("/post-test", (req, res) => {
|
|||
return res.status(200).json({ "success": true, "message": "POST request received", "data": req.body })
|
||||
});
|
||||
|
||||
app.get("/tnyk/:sf_token", (req, res) => {
|
||||
const sf_token = req.params.sf_token;
|
||||
console.log("Received token:", sf_token);
|
||||
|
||||
try {
|
||||
const decoded = jwt.verify(sf_token, process.env.JWT_SECRET_SF_TOKEN);
|
||||
if (decoded) {
|
||||
res.render('client/dashboard-dashboard', { sf_token: sf_token });
|
||||
} else {
|
||||
res.render('not_found', { title: "Client" });
|
||||
}
|
||||
} catch (error) {
|
||||
res.render('not_found', { title: "Client" });
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
app.use((req, res) => {
|
||||
res.status(404).render("not_found", {
|
||||
layout: "layouts/error",
|
||||
|
|
|
|||
|
|
@ -171,12 +171,20 @@
|
|||
|
||||
// -------- Download --------
|
||||
downloadBtn.addEventListener("click", () => {
|
||||
const activeBtn = document.querySelector(".os-btn.active")
|
||||
const os = activeBtn.dataset.os;
|
||||
|
||||
const link = document.createElement("a");
|
||||
|
||||
if(os === "mac") {
|
||||
link.href = `/public/builds/build-1.1.1.1/mac/VA Tracker-1.1.1-universal.dmg`;
|
||||
link.setAttribute("download", "");
|
||||
} else if (os === "windows") {
|
||||
link.href = `/public/builds/build-1.1.1.1/windows/VA Tracker-Setup-1.1.1.exe`;
|
||||
link.setAttribute("download", "");
|
||||
link.click()
|
||||
}
|
||||
|
||||
link.click()
|
||||
// window.location.href = ``;
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue