Skip to content

Commit

Permalink
Fix parse glossary list
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Apr 3, 2024
1 parent 6ab38eb commit 4dd4fb1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/deepl/translator.cr
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,8 @@ module DeepL
url = "#{server_url}/glossaries"
response = Crest.get(url, headers: http_headers_base)
handle_response(response, glossary: true)
JSON.parse(response.body)["glossaries"].as_a.map do |g|
GlossaryInfo.from_json(g)
end
glossaries_json = JSON.parse(response.body)["glossaries"].to_s
Array(GlossaryInfo).from_json(glossaries_json)
end

def get_glossary_entries_from_id(glossary_id : String)
Expand Down

0 comments on commit 4dd4fb1

Please sign in to comment.