Skip to content

Commit

Permalink
Return a 404 if the word to confirm wasn't found
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
egli committed Mar 1, 2021
1 parent 5af0180 commit c967ec4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/clj/daisyproducer2/routes/services.clj
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@
:hyphenated (spec/maybe ::hyphenation)
:spelling ::spelling}}
:handler (fn [{{word :body} :parameters}]
(confirm/put-word word)
(no-content))}}]
(let [modified (confirm/put-word word)]
(if (> modified 0)
(no-content)
(not-found))))}}]

["/hyphenations"
{:swagger {:tags ["Hyphenations"]}}
Expand Down

0 comments on commit c967ec4

Please sign in to comment.