Closed gutenye closed 8 years ago
Hi @gutenye what's the error ? Also what is your config/footprints.js
configuration ?
The error is
GET /users/1?populate=posts
HTTP/1.1 412 Precondition Failed
{
"error": "Precondition Failed",
"message": "errors.footprints.find.mutex",
"statusCode": 412
}
My config/footprints.js is https://gist.github.com/gutenye/41ac7f96e9b01c87d12652f989aedde2
Hum can you test with a prefix ? Maybe there a problem when there no prefix, I never had a problem like this before the only difference is that I use a prefix.
Also if your model is called User
you should call /user/1?populate=posts
instead, I think plural are not supported yet.
With prefix, it works without an error.
What is this file https://github.com/trailsjs/trailpack-express/blob/master/api/policies/FootprintPolicy.js#L34 for?
EDIT: with prefix, it is still not working.
@gutenye ho I see the problem you're right we should test if criteria
is not empty and not query
! I'll fix this soon!
I can replicate your problem it work great with or without prefix for me if I didn't set ?populate=post
but once I set it I have the 412 error.
@gutenye I just create a PR with the fix, can you test it and let me know if it's fix your problem ? Normally it should.
Thanks
In https://github.com/trailsjs/trailpack-express/blob/master/api/policies/FootprintPolicy.js#L34
Got an error in following example
This request should be valid