From 9765f2aa4f7d6840f485fe159ee9e94c4f76ef23 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 13 Aug 2021 12:11:51 +0200
Subject: [PATCH] json

---
 app/views/research/journal/volumes/_volume.json.jbuilder | 2 --
 app/views/research/journal/volumes/index.json.jbuilder   | 5 ++++-
 app/views/research/journal/volumes/show.json.jbuilder    | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)
 delete mode 100644 app/views/research/journal/volumes/_volume.json.jbuilder

diff --git a/app/views/research/journal/volumes/_volume.json.jbuilder b/app/views/research/journal/volumes/_volume.json.jbuilder
deleted file mode 100644
index e53ca1692..000000000
--- a/app/views/research/journal/volumes/_volume.json.jbuilder
+++ /dev/null
@@ -1,2 +0,0 @@
-json.extract! volume, :id, :title, :number, :published_at, :created_at, :updated_at
-json.url research_journal_volume_url(journal: volume.journal, id: volume, format: :json)
diff --git a/app/views/research/journal/volumes/index.json.jbuilder b/app/views/research/journal/volumes/index.json.jbuilder
index bb11ceb64..3894f90d2 100644
--- a/app/views/research/journal/volumes/index.json.jbuilder
+++ b/app/views/research/journal/volumes/index.json.jbuilder
@@ -1 +1,4 @@
-json.array! @research_journal_volumes, partial: "research_journal_volumes/research_journal_volume", as: :research_journal_volume
+json.array! @volumes do |volume|
+  json.extract! volume, :id, :title, :number, :published_at
+  json.url research_journal_volume_url(journal_id: volume.journal, id: volume, format: :json)
+end
diff --git a/app/views/research/journal/volumes/show.json.jbuilder b/app/views/research/journal/volumes/show.json.jbuilder
index 5795a060c..3ae703e7d 100644
--- a/app/views/research/journal/volumes/show.json.jbuilder
+++ b/app/views/research/journal/volumes/show.json.jbuilder
@@ -1 +1,2 @@
-json.partial! "research/journal/volumes/volume", volume: @volume
+json.extract! @volume, :id, :title, :number, :published_at, :created_at, :updated_at
+json.url research_journal_volume_url(journal: @volume.journal, id: @volume, format: :json)
-- 
GitLab