Skip to content

Commit

Permalink
Dropped the unknown column hint after PR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljungberg committed Nov 28, 2022
1 parent 51c13dc commit 0606c69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PostgREST/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ instance JSON.ToJSON ApiRequestError where
"code" .= ApiRequestErrorCode18,
"message" .= ("Could not find '" <> colName <> "' in the target table" :: Text),
"details" .= JSON.Null,
"hint" .= ("If a new column was created in the database with this name, try reloading the schema cache." :: Text)]
"hint" .= JSON.Null]

compressedRel :: Relationship -> JSON.Value
-- An ambiguousness error cannot happen for computed relationships TODO refactor so this mempty is not needed
Expand Down
2 changes: 1 addition & 1 deletion test/spec/Feature/Query/InsertSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ spec actualPgVersion = do
{"id": 204, "body": "yyy"},
{"id": 205, "body": "zzz"}]|]
`shouldRespondWith`
[json|{"code":"PGRST118","details":null,"hint":"If a new column was created in the database with this name, try reloading the schema cache.","message":"Could not find 'helicopter' in the target table"} |]
[json|{"code":"PGRST118","details":null,"hint":null,"message":"Could not find 'helicopter' in the target table"} |]
{ matchStatus = 400
, matchHeaders = []
}
Expand Down
2 changes: 1 addition & 1 deletion test/spec/Feature/Query/UpdateSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ spec = do
[("Prefer", "return=representation")]
[json|{"body": "yyy"}|]
`shouldRespondWith`
[json|{"code":"PGRST118","details":null,"hint":"If a new column was created in the database with this name, try reloading the schema cache.","message":"Could not find 'helicopter' in the target table"} |]
[json|{"code":"PGRST118","details":null,"hint":null,"message":"Could not find 'helicopter' in the target table"} |]
{ matchStatus = 400
, matchHeaders = []
}
Expand Down

0 comments on commit 0606c69

Please sign in to comment.