From 778465fe0bad8646edf0d2f18e58ce3edfd8c6cb Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 29 Jul 2024 20:12:33 +0200 Subject: [PATCH] Keep previous format of JSON repsonses before Rails 7 --- app/controllers/json_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/json_controller.rb b/app/controllers/json_controller.rb index 611bdf2..4928314 100644 --- a/app/controllers/json_controller.rb +++ b/app/controllers/json_controller.rb @@ -10,20 +10,20 @@ class JsonController < ApplicationController def packages expires_in 1.days, public: true @p = Package.all - render json: @p + render json: { packages: @p } end # JSON information on all screenshots def screenshots expires_in 1.days, public: true @s = Screenshot.approved.includes(:package) - render json: @s + render json: { screenshots: @s } end # JSON list of packages that do not have screenshots def packages_without_screenshots expires_in 1.hours, public: true @p = Package.without_screenshots.all - render json: @p + render json: { packages: @p } end end