adobe / acc-js-sdk

A JavaScript SDK for Adobe Campaign Classic
Apache License 2.0
21 stars 20 forks source link

Element of type memo is coming as empty Object when there is not value in it. #78

Closed 19akashsharma closed 2 months ago

19akashsharma commented 1 year ago

Hi Team, I am facing below issue when I try to access the Element of type Memo using query def:

export const queryDef = (schemaName: string, id: string, customProps: Record<string, XtkSchemaNode>): QueryDef => { const query = { operation: 'get', schema: schemaName, select: { node: [{ expr: '@id' }], }, where: { condition: [ { expr:@id = ${id}, }, ], }, }; Object.keys(customProps).map((propKey: string) => { query.select.node.push({ expr: customProps[propKey]?.parent?.parent?.id != schemaName || propKey.includes('-id') ?[${customProps[propKey].nodePath.slice(1)}]// Non Root children Attributes :${customProps[propKey].nodePath.slice(1)}, // Root children Attributes }); }); return query; }; It is returning memo field as empty object like below: testmemoElement: {} But it is expected to come as below: $testmemoElement: ""

I am using two field of type element those are CDATA and memo. but CDATA is coming as expected, when it is empty. memo field is coming as empty object when it is empty.

mkiki commented 1 year ago

Hi @19akashsharma , this is a known issue, it should be fixed with https://github.com/adobe/acc-js-sdk/pull/58

mkiki commented 2 months ago

Closing this one. @19akashsharma , please reopen if needed.