Big Fix
This commit is contained in:
parent
d49ba5a8b1
commit
db51e213f1
|
|
@ -50,7 +50,8 @@ async function va_register(req, res) {
|
|||
// Send data to Salesforce API after successful registration
|
||||
try {
|
||||
const salesforceUrl = `${process.env.SF_DOCTRACKER_API_URL}services/apexrest/docva/api/virtualassistant`;
|
||||
|
||||
delete created.userDetails._id;
|
||||
created.userDetails._id = created._id; // Include VA's MongoDB ID
|
||||
const response = await fetch(salesforceUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ const projectSchema = new Schema({
|
|||
],
|
||||
dedicatedHours: {
|
||||
type: String,
|
||||
default: 0
|
||||
default: "0"
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
|
|
|
|||
|
|
@ -109,13 +109,18 @@ app.get('/varegister/:sf_token?', (req, res) => {
|
|||
});
|
||||
|
||||
app.get('/clientregister/:sf_token?', (req, res) => {
|
||||
const { sf_token } = req.params;
|
||||
try {
|
||||
const decoded = jwt.verify(sf_token, process.env.JWT_SECRET_SF_TOKEN);
|
||||
|
||||
// portalId: RECORDid => 8990928342309
|
||||
// email
|
||||
|
||||
// const { sf_token } = useParams();
|
||||
|
||||
if (decoded) {
|
||||
res.render('va_client_register', { title: "Client Registration" });
|
||||
} else {
|
||||
res.render('not_found', { title: "Client Registration" });
|
||||
}
|
||||
} catch (error) {
|
||||
res.render('not_found', { title: "Client Registration" });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/auth/password/reset-form', render_reset_form);
|
||||
|
|
|
|||
Loading…
Reference in New Issue