Include archive error messages in API response

This commit is contained in:
Alex Ling 2022-03-22 11:42:25 +00:00
parent c778364ca2
commit 61e85dd49f
1 changed files with 4 additions and 1 deletions

View File

@ -55,9 +55,12 @@ class Entry
def build_json(*, slim = false)
JSON.build do |json|
json.object do
{% for str in ["zip_path", "title", "size", "id"] %}
{% for str in %w(zip_path title size id) %}
json.field {{str}}, @{{str.id}}
{% end %}
if err_msg
json.field "err_msg", err_msg
end
json.field "title_id", @book.id
json.field "sort_title", sort_title
json.field "pages" { json.number @pages }