Skip to content

Commit

Permalink
Allow articles to have many categories (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin authored Oct 10, 2023
1 parent 3cd61fa commit ad551c1
Show file tree
Hide file tree
Showing 3 changed files with 973 additions and 955 deletions.
4 changes: 2 additions & 2 deletions src/api/article/content-types/article/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"videos"
]
},
"category": {
"categories": {
"type": "relation",
"relation": "manyToOne",
"relation": "manyToMany",
"target": "api::category.category",
"inversedBy": "articles"
},
Expand Down
10 changes: 5 additions & 5 deletions src/api/category/content-types/category/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"slug": {
"type": "uid"
},
"description": {
"type": "text"
},
"articles": {
"type": "relation",
"relation": "oneToMany",
"relation": "manyToMany",
"target": "api::article.article",
"mappedBy": "category"
},
"description": {
"type": "text"
"mappedBy": "categories"
}
}
}
Loading

0 comments on commit ad551c1

Please sign in to comment.