Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Fix internal server error when trying to filter a field that's not allowed #506

Merged
merged 3 commits into from
Nov 6, 2018

Conversation

unnawut
Copy link
Contributor

@unnawut unnawut commented Nov 1, 2018

Closes #505

Overview

This PR fixes the internal server error that is returned when attempting to filter records with a field that's not allowed.

This PR is based on the changes in #501 so it's based out of #501 until merged.

Changes

  • Handles when {:error, :not_allowed, field} is returned by the parser in EWallet.Web.Orchestrator

Implementation Details

N/A

Usage

curl 10.5.10.10:4000/api/admin/transaction.all -H "Accept: application/vnd.omisego.v1+json" -H "Authorization: OMGAdmin <truncated>" -H "Content-Type: application/json" -d '{
  "match_all": [
    {
      "comparator": "eq",
      "field": "1232131",
      "value": true
    }
  ],
  "page": 1,
  "per_page": 10,
  "sort_by": "name",
  "sort_dir": "asc"
}' -v -w "\n"

Should now return a client:invalid_parameter error rather than an internal_server_error error.

Impact

No DB or API changes.

@unnawut unnawut changed the base branch from 501-match-any to master November 6, 2018 03:34
@unnawut unnawut merged commit 7dcaca8 into master Nov 6, 2018
@ghost ghost removed the s2/wip 🚧 label Nov 6, 2018
@unnawut unnawut deleted the 505-filter-not-allowed branch November 6, 2018 04:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal server error when trying to filter a non-whitelisted field
2 participants