I'm failing to set a value in this constant:
const targetedMessageTemplate = {
"query": createTargetedMessage(input: {
conversationId: '',
targetUserId: '',
targetDialogId: '',
annotations: [{
genericAnnotation: {
title: '',
text: ''
}
}]
})
};
When calling this:
var test= targetedMessageTemplate;
test.annotations[0].title = 'Test title';
Returns:
TypeError: cannot read '0' of undefined.
Setting the value of the conversationId variable works fine, however accessing the annotations array seems to be an issue.
Any hint appreciated on what I'm missing is highly appreciated. Thank you