Skip to content

Commit

Permalink
one last grants API update
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Nov 11, 2020
1 parent b90b8e4 commit 28236e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/grants/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def get_queryset(self):
if 'pk' in param_keys:
queryset = queryset.filter(pk=self.request.query_params.get('pk'))

# Filter by admin_address.
if 'admin_address' in param_keys:
queryset = queryset.filter(admin_address__iexact=self.request.query_params.get('admin_address'))

# Filter by description.
if 'description' in param_keys:
queryset = queryset.filter(description__iexact=self.request.query_params.get('description'))
Expand Down
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ The grants endpoint provides a listing of grants and all it's information. There

**Filters**

You can filter the data returned from the API by providing these keys as URL parameters `title`, `description`, `keyword`, `grant_type` and `pk` that takes an ID and returns a single grant. You can also add a `limit` parameter to limit the results (typically for performance reasons).
You can filter the data returned from the API by providing these keys as URL parameters `title`, `admin_address`, `description`, `keyword`, `grant_type` and `pk` that takes an ID and returns a single grant. You can also add a `limit` parameter to limit the results (typically for performance reasons).


#### Example Request
Expand Down

0 comments on commit 28236e6

Please sign in to comment.