Added missing jbuilder

This was the reason why JSON output was incorrectly formatted.
This commit is contained in:
Christoph Haas 2024-08-05 16:19:32 +02:00
parent 7fdd1332b7
commit 890906929f
3 changed files with 5 additions and 5 deletions

View file

@ -3,27 +3,23 @@ class JsonController < ApplicationController
def package
expires_in 1.hours, public: true
@p = Package.find_by_name! params[:name]
render json: @p
end
# JSON information on all packages
def packages
expires_in 1.days, public: true
@p = Package.all
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: { 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: { packages: @p }
end
end