Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

todolist example not work correctly(inclusion show in document but not same with the response) #3960

Closed
st119848 opened this issue Oct 17, 2019 · 8 comments

Comments

@st119848
Copy link

Steps to reproduce

Run the lb4 example command to select and clone the todo repository:

lb4 example todo-list
Switch to the directory.

cd loopback4-example-todo-list
Finally, start the application!

$ npm start

Server is running at http://127.0.0.1:3000

or i clone your entire github and start in example todolist folder the result is the same .

Current Behavior

In the api document show example result with inclusion(relate model) but actual result format not same as example result.

Expected Behavior

Response same pattern as example result (with inclusion (relate model))

@st119848 st119848 added the bug label Oct 17, 2019
@dhmlau
Copy link
Member

dhmlau commented Oct 17, 2019

@nabdelgadir @agnes512 , could you please take a look? Thanks.

@agnes512
Copy link
Contributor

@st119848 Hi, could you add more details about this issue? such as what request you tried, the result you got, and which part of the API docs are inconsistent. thanks!

@st119848
Copy link
Author

st119848 commented Oct 18, 2019

Ok this is what i expect. and the document api show
Screen Shot 2562-10-19 at 00 02 08
But this is the actual server response
Screen Shot 2562-10-19 at 00 03 19
May be it about filter configuration please help me to config it (may be).

@nabdelgadir
Copy link
Contributor

Hi @st119848, so this is actually a limitation of the explorer (#2208). If you notice the request url, it's http://localhost:3000/todo-lists instead of http://localhost:3000/todo-lists?filter[include][][relation]=todos. Try using the url instead of doing the request through the explorer.

@st119848
Copy link
Author

thank you i will try to use api with url and filter url.

@st119848 st119848 reopened this Oct 19, 2019
@st119848
Copy link
Author

what if i want to use more inclusion in the inclusion what pattern url will be ? or you can send me about link to read about it

@st119848
Copy link
Author

st119848 commented Oct 19, 2019

/customers?filter[include][reviews]=author ? oh this is from lb3 and it not use relation.

@st119848
Copy link
Author

relate to this issue #3453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants