Closed Nabelops closed 1 year ago
https://kontent.ai/learn/docs/apis/openapi/delivery-api/#operation/retrieve-a-content-type-element
ERROR TypeError: Cannot read properties of undefined (reading 'codename')
this.client.element('whatever', 'category')
generic-element.mapper.js
Response does not seem to be an object with an property of element
element
{ "type": "multiple_choice", "name": "category", "options": [ { "name": "thing", "codename": "thing" }, { "name": "another thing", "codename": "another_thing" } ], "codename": "category" }
Returns an an element
We use it to help sort things by the multiple choice field. E.g. Nav sub menu of the categories multi-choice.
Add links to screenshots, if possible.
Hi @Nabelops,
There was a change in the API which caused this to happen. We've updated this SDK and it should work correctly in v 14.4.0.
14.4.0
Brief bug description
https://kontent.ai/learn/docs/apis/openapi/delivery-api/#operation/retrieve-a-content-type-element
ERROR TypeError: Cannot read properties of undefined (reading 'codename')
Repro steps
this.client.element('whatever', 'category')
, this element is a multi-choicegeneric-element.mapper.js
seems to be the source of the error.Response does not seem to be an object with an property of
element
Expected behavior
Returns an an element
Test environment
Additional context
We use it to help sort things by the multiple choice field. E.g. Nav sub menu of the categories multi-choice.
Screenshots
Add links to screenshots, if possible.