Keep previous format of JSON repsonses before Rails 7
This commit is contained in:
parent
142780c308
commit
778465fe0b
1 changed files with 3 additions and 3 deletions
|
|
@ -10,20 +10,20 @@ class JsonController < ApplicationController
|
||||||
def packages
|
def packages
|
||||||
expires_in 1.days, public: true
|
expires_in 1.days, public: true
|
||||||
@p = Package.all
|
@p = Package.all
|
||||||
render json: @p
|
render json: { packages: @p }
|
||||||
end
|
end
|
||||||
|
|
||||||
# JSON information on all screenshots
|
# JSON information on all screenshots
|
||||||
def screenshots
|
def screenshots
|
||||||
expires_in 1.days, public: true
|
expires_in 1.days, public: true
|
||||||
@s = Screenshot.approved.includes(:package)
|
@s = Screenshot.approved.includes(:package)
|
||||||
render json: @s
|
render json: { screenshots: @s }
|
||||||
end
|
end
|
||||||
|
|
||||||
# JSON list of packages that do not have screenshots
|
# JSON list of packages that do not have screenshots
|
||||||
def packages_without_screenshots
|
def packages_without_screenshots
|
||||||
expires_in 1.hours, public: true
|
expires_in 1.hours, public: true
|
||||||
@p = Package.without_screenshots.all
|
@p = Package.without_screenshots.all
|
||||||
render json: @p
|
render json: { packages: @p }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue