Skip to content

Commit

Permalink
Merge pull request #835 from OpenSignLabs/fix_linkcontact
Browse files Browse the repository at this point in the history
  • Loading branch information
nxglabs committed Jun 12, 2024
2 parents 4d7348a + 655401e commit 9ef1e22
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions apps/OpenSignServer/cloud/parsefunction/linkContactToDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ export default async function linkContactToDoc(req) {
const updateDoc = new Parse.Object('contracts_Document');
updateDoc.id = docId;
const signers = _docRes?.Signers || [];
signers.push({
const signerobj = {
__type: 'Pointer',
className: 'contracts_Contactbook',
objectId: existContact.id,
});
};
// The splice method is used to add a signer at the desired index
// index is the variable where the signer needs to be added
// 0 indicates that no elements should be deleted
// signerobj is the reference to the signer object
signers.splice(index, 0, signerobj);
updateDoc.set('Signers', signers);

Placeholders[index] = {
Expand Down Expand Up @@ -128,11 +133,16 @@ export default async function linkContactToDoc(req) {
const updateDoc = new Parse.Object('contracts_Document');
updateDoc.id = docId;
const signers = _docRes?.Signers || [];
signers.push({
const signerobj = {
__type: 'Pointer',
className: 'contracts_Contactbook',
objectId: contactRes.id,
});
};
// The splice method is used to add a signer at the desired index
// index is the variable where the signer needs to be added
// 0 indicates that no elements should be deleted
// signerobj is the reference to the signer object
signers.splice(index, 0, signerobj);
updateDoc.set('Signers', signers);

Placeholders[index] = {
Expand Down Expand Up @@ -175,11 +185,16 @@ export default async function linkContactToDoc(req) {
const updateDoc = new Parse.Object('contracts_Document');
updateDoc.id = docId;
const signers = _docRes?.Signers || [];
signers.push({
const signerobj = {
__type: 'Pointer',
className: 'contracts_Contactbook',
objectId: contactRes.id,
});
};
// The splice method is used to add a signer at the desired index
// index is the variable where the signer needs to be added
// 0 indicates that no elements should be deleted
// signerobj is the reference to the signer object
signers.splice(index, 0, signerobj);
updateDoc.set('Signers', signers);

Placeholders[index] = {
Expand Down Expand Up @@ -227,13 +242,17 @@ export default async function linkContactToDoc(req) {
const updateDoc = new Parse.Object('contracts_Document');
updateDoc.id = docId;
const signers = _docRes?.Signers || [];
signers.push({
const signerobj = {
__type: 'Pointer',
className: 'contracts_Contactbook',
objectId: contactRes.id,
});
};
// The splice method is used to add a signer at the desired index
// index is the variable where the signer needs to be added
// 0 indicates that no elements should be deleted
// signerobj is the reference to the signer object
signers.splice(index, 0, signerobj);
updateDoc.set('Signers', signers);

Placeholders[index] = {
...Placeholders[index],
signerObjId: contactRes.id,
Expand Down

0 comments on commit 9ef1e22

Please sign in to comment.