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

No record found for id '${id}' #184

Closed
RaduGrama opened this issue Jan 4, 2019 · 4 comments
Closed

No record found for id '${id}' #184

RaduGrama opened this issue Jan 4, 2019 · 4 comments

Comments

@RaduGrama
Copy link

RaduGrama commented Jan 4, 2019

Run code like service('abc').patch(1, values) fails with the error above. It looks like in line 263 the test items.length === 1 returns false because items has a data field that has a length.

In release 4.0.0 there was an const items = page.data; statement a few lines above, but it's gone starting with 5.0.0 and both 5.0.0 and 5.0.1 exhibit this issue.

@daffl
Copy link
Member

daffl commented Jan 4, 2019

Do you have more information about your setup? This simple case is being tested and should be working.

If you have a look at the migration guide you can see that the query will now be included when trying to look up the record. If you do not want that you will have to clean up the query in a hook.

@jbiffis
Copy link

jbiffis commented Jan 16, 2019

Running into the same issue. Fails in the same spot. items.data has the returned array from db but items.length returns false.

I'm not sure how to clean up the query in a hook. There is no query that I'm sending with this call. In my case: return context.app.service('api/teams').patch(context.id, { 'is_active' : false})

@lvivier
Copy link
Contributor

lvivier commented Jan 16, 2019

I'm having the same issue as well. In my case, it only happens if {paginate: {default: n}} is in the options for the service. I'll try to follow up with a small test case.

@daffl
Copy link
Member

daffl commented Jan 16, 2019

Yep, that was it. Fixed in v5.0.3

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

No branches or pull requests

4 participants