[feature/backend] add categories param in posts
This commit is contained in:
parent
958e3c2886
commit
be8bf22017
21 changed files with 448 additions and 281 deletions
|
@ -34,8 +34,7 @@ func (Post) Edges() []ent.Edge {
|
|||
return []ent.Edge{
|
||||
edge.To("contents", PostContent.Type),
|
||||
edge.To("contributors", PostContributor.Type),
|
||||
edge.From("category", Category.Type).
|
||||
Ref("posts").
|
||||
Unique(),
|
||||
edge.From("categories", Category.Type).
|
||||
Ref("posts"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue