Justoverclock I finally failed to do that.
I want to create a discussion with a tag which id is 1 and its parent tag which id is 2. I checked tags' code but didn't understand clearly. I checked /api/discussion/, and write the following codes.
const data = {
title: title,
content: content,
relationships: {
tags : {
0: {
type: 'tags',
id: '1',
},
1:{
type: 'tags',
id: '2',
}
}
}
}
app.store
.createRecord('discussions')
.save(data)
.then((discussion) => {
app.discussions.refresh({deferClear: true});
m.route.set(app.route.discussion(discussion));
},);
console.log(data)
}
//Uncaught TypeError: t.data is undefined
And I can't close the DiscussionComposer after post.