documentation icon indicating copy to clipboard operation
documentation copied to clipboard

[Request]: V4 More extensive Entity Service CRUD documentation

Open Luny-S opened this issue 4 years ago • 0 comments

Summary

I would like to request an extension to Entiy Service CRUD documentation as it only contains simple examples. I'd propose adding examples of using components and related components for each method. It should also contain information (or link to i18n doc) how to handle content-types with i18n feature.

Why is it needed?

I was creating a seeder for few content-types in my project which were related to each other and had to experiment on how to pass data object to create method. It led to wasting a lot of time and I'd love to see that in the documentation.

In addition, I encountered one inconsistency in passing ID of related object which misleaded me in finding the correct approach:

For relation "Article has one author" we can create Article with data:

{
    title: 'Lorem ipsum',
    ...
    author: <id value>
}

or

{
    title: 'Lorem ipsum',
    ...
    author: {
         id: <id value>
    }
}

whereas for relation "Article has and belongs to one Author" the second method results in an error.

Suggested solution(s)

Writing a more extensive CRUD doc based on Article/Author, or other, simple examples. Articles could have i18n feature in this example.

Related issue(s)/PR(s)

No response

Luny-S avatar Dec 08 '21 14:12 Luny-S