fix: include http error code on json api format
This commit is contained in:
parent
6499c0a9ab
commit
b32e0bdbb0
|
|
@ -39,7 +39,10 @@
|
||||||
(define-api-format json (data)
|
(define-api-format json (data)
|
||||||
"JSON API format for Radiance"
|
"JSON API format for Radiance"
|
||||||
(setf (header "Content-Type") "application/json")
|
(setf (header "Content-Type") "application/json")
|
||||||
(cl-json:encode-json-to-string data))
|
(let ((status (gethash "status" data)))
|
||||||
|
(when (and status (boundp '*response*))
|
||||||
|
(setf (return-code *response*) status))
|
||||||
|
(cl-json:encode-json-to-string data)))
|
||||||
|
|
||||||
;; Set JSON as the default API format
|
;; Set JSON as the default API format
|
||||||
(setf *default-api-format* "json")
|
(setf *default-api-format* "json")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue