Merge pull request #1218 from OpenSignLabs/validation

This commit is contained in:
Andrew
2024-09-18 19:57:46 +05:30
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -197,7 +197,7 @@ export default async function createDocumentWithTemplate(request, response) {
object.set('TimeToCompleteDays', TimeToCompleteDays);
}
const enableOTP = request.body?.enableOTP === true ? true : false;
const IsEnableOTP = template?.IsEnableOTP || enableOTP;
const IsEnableOTP = enableOTP || template?.IsEnableOTP || false;
object.set('IsEnableOTP', IsEnableOTP);
object.set('CreatedBy', template.CreatedBy);
object.set('ExtUserPtr', {
@@ -12,7 +12,7 @@ export default async function callWebhook(request) {
const docRes = await docQuery.get(docId, { useMasterKey: true });
const isEnableOTP = docRes?.get('IsEnableOTP') || false;
let userId;
if (!isEnableOTP) {
if (isEnableOTP) {
const userRes = await axios.get(serverUrl + '/users/me', {
headers: {
'X-Parse-Application-Id': appId,