acc-js-sdk icon indicating copy to clipboard operation
acc-js-sdk copied to clipboard

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

Open 19akashsharma opened this issue 2 years ago • 1 comments

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.

19akashsharma avatar Mar 06 '23 06:03 19akashsharma

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

mkiki avatar Mar 06 '23 07:03 mkiki

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

mkiki avatar May 13 '24 09:05 mkiki