Skip to content

Commit

Permalink
Merge pull request #267 from credebl/bulk-issuance-retry
Browse files Browse the repository at this point in the history
fix: multiple aattribute issue
  • Loading branch information
nishad-ayanworks authored Nov 20, 2023
2 parents 610bb2b + 44c6cae commit fcad703
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions apps/issuance/src/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,25 +839,19 @@ export class IssuanceService {
fileUploadData.clientId = jobDetails.clientId;
try {

const oobIssuancepayload: OutOfBandCredentialOfferPayload = {
credentialDefinitionId: '',
orgId: 0
const oobIssuancepayload = {
credentialDefinitionId: jobDetails.credentialDefinitionId,
orgId: jobDetails.orgId,
attributes: [],
emailId: jobDetails.data.email
};

for (const key in jobDetails.data) {
if (jobDetails.data.hasOwnProperty(key)) {
if (jobDetails.data.hasOwnProperty(key) && 'email' !== key) {
const value = jobDetails.data[key];
// eslint-disable-next-line no-unused-expressions
if ('email' !== key) {
oobIssuancepayload['attributes'] = [{ name: key, value }];
} else {
oobIssuancepayload['emailId'] = value;
}

oobIssuancepayload.attributes.push({ name: key, value });
}
}
oobIssuancepayload['credentialDefinitionId'] = jobDetails.credentialDefinitionId;
oobIssuancepayload['orgId'] = jobDetails.orgId;

const oobCredentials = await this.outOfBandCredentialOffer(
oobIssuancepayload
Expand Down

0 comments on commit fcad703

Please sign in to comment.