crud
crud copied to clipboard
Add warning when using disallowed relation
This will output a warning if you're trying to join a relation that isn't allowed by the controller.
example: The controller config:
@Crud({
model: {
type: StoreEntity,
},
query: {
join: {
users: {},
departments: {},
},
},
})
This call:
/api/stores?fields=name&join=user&join=departments
Would log this warning:
relation 'user' not found in allowed relations in the controller. Did you mean to use one of these? [users, departments]
I'm not sure if logging this to the console is the best idea. We might need to put this behind a verbose flag somewhere?
Merged on https://github.com/rewiko/crud/issues/5