askvortsov odd, this extension can't tag a discussion on my test flarum forum, but when I installed it on my forum(both version is 1.0.4), it works.
Now met another problem, I want to create a discussion with Tag ID 55, and its parent tag which id is 53.
const data = {
title: title,
content: content,
relationships: {
tags: [{
data: [{
type: "tags",
id: "53" ,
},{
type: "tags",
id: "55" ,
}]
}]
}
}
error:
POST https://mystie.com/api/discussions
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`web_flarum`.`discussion_tag`, CONSTRAINT `discussion_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE)
Then I tried:
const data = {
title: title,
content: content,
relationships: {
tags: {
data: [{
type: "tags",
id: "53" ,
},{
type: "tags",
id: "55" ,
}]
}
}
}
Then no error, but the new discussion has no tags.