feat: expose closed boolean in card JSON API

Adds `closed` field to card JSON response, allowing API consumers
to detect closed status without parsing the status enum or making
additional API calls.
This commit is contained in:
Abdelkader Boudih
2025-12-12 10:12:21 +01:00
parent c43c184691
commit b5caa8716d
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ json.cache! card do
json.tags card.tags.pluck(:title).sort
json.closed card.closed?
json.golden card.golden?
json.last_active_at card.last_active_at.utc
json.created_at card.created_at.utc
@@ -145,6 +145,7 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_equal card.title, @response.parsed_body["title"]
assert_equal card.closed?, @response.parsed_body["closed"]
assert_equal 2, @response.parsed_body["steps"].size
end