edisonywh / backoffice

Admin tool built with the PETAL stack
MIT License
217 stars 15 forks source link

Add query to Ecto resolver's options #44

Closed NduatiK closed 3 years ago

NduatiK commented 3 years ago

Resolve #42

Adds support for query and default_order_by to resolver_opts.

query is a 1 arity function that accepts the resource and allows the developers to customize the query used to request resources in index.

default_order_by accepts a list of field names that will be used to order the resources.

Also included are tests and an update to the readme.

NduatiK commented 3 years ago

Wow. Using Mox really simplified the tests! @edisonywh I have made the requested changes.

edisonywh commented 3 years ago

I've looked through the PR and I think it looks amazing! I'm just going to push a commit to fix some formatting issues then I'll go ahead and merge it. Thanks for the contribution @NduatiK!

🚀 🚀 🚀