Skip to content

Commit

Permalink
CMR-9848:
Browse files Browse the repository at this point in the history
  • Loading branch information
siwei xu authored and siwei xu committed Sep 18, 2024
1 parent 61eb516 commit f46c405
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions search-app/src/cmr/search/api/tags.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
[headers]
(mt/extract-header-mime-type #{mt/json} headers "content-type" true))

(defn- all-data-contain-errors?
"Whether all entries in data contain errors."
(defn- has-error?
"Whether there's an error in [data]."
[data]
(not (some #(nil? (:errors %)) data)))
(some #(contains? % :errors) data))

(defn tag-api-response
"Creates a successful tag response with the given data response"
([data]
(if (all-data-contain-errors? data)
(if (has-error? data)
(tag-api-response 400 data)
(tag-api-response 200 data)))
([status-code data]
Expand Down

0 comments on commit f46c405

Please sign in to comment.