Skip to content

Commit

Permalink
Merge pull request #33 from ringcentral/customerLinkPhone
Browse files Browse the repository at this point in the history
Customer link phone
  • Loading branch information
DaKingKong authored Jul 1, 2024
2 parents 4b104b0 + 3a1b333 commit 3f9aaa5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/adapters/netsuite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ async function createCallLog({ user, contactInfo, authHeader, callLog, note, add
});
postBody.contact = { id: contactInfo.id };
postBody.company = { id: contactInfoRes.data?.company?.id };
} else if (contactInfo.type === 'custjob') {
postBody.company = { id: contactInfo.id };
}
console.log(`adding call log... \n${JSON.stringify(callLog, null, 2)}`);
console.log(`with note... \n${note}`);
Expand Down Expand Up @@ -372,6 +374,8 @@ async function createMessageLog({ user, contactInfo, authHeader, message, additi
});
postBody.data.contact = { id: contactInfo.id };
postBody.data.company = { id: contactInfoRes.data?.company?.id };
} else if (contactInfo.type === 'custjob') {
postBody.data.company = { id: contactInfo.id };
}
const addLogRes = await axios.post(
`https://${user.hostname.split(".")[0]}.suitetalk.api.netsuite.com/services/rest/record/v1/phonecall`,
Expand Down
5 changes: 4 additions & 1 deletion src/core/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ async function onOAuthCallback({ platform, hostname, tokenUrl, callbackUri, apiU
};
}
else {
returnMessage
return {
userInfo: null,
returnMessage
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ app.get('/oauth-callback', async function (req, res) {
username: req.query.username,
query: req.query
});
const jwtToken = jwt.generateJwt({
id: userInfo.id.toString(),
platform: platform
});
if (!!userInfo) {
const jwtToken = jwt.generateJwt({
id: userInfo.id.toString(),
platform: platform
});
res.status(200).send({ jwtToken, name: userInfo.name, returnMessage });
success = true;
}
else {
res.status(500).send({ returnMessage });
res.status(200).send({ returnMessage });
success = false;
}
}
Expand Down

0 comments on commit 3f9aaa5

Please sign in to comment.