Add a limit to the number of items for the Item Getting Guide

Just to make it harder to willfully overload the server or whatever!
This commit is contained in:
Emi Matchu 2024-05-22 15:47:38 -07:00
parent 1b03c2caed
commit a8648fc9c1

View file

@ -114,7 +114,8 @@ class ItemsController < ApplicationController
def sources def sources
item_ids = params[:ids].split(",") item_ids = params[:ids].split(",")
@items = Item.where(id: item_ids).includes(:nc_mall_record).order(:name) @items = Item.where(id: item_ids).includes(:nc_mall_record).order(:name).
limit(50)
if @items.empty? if @items.empty?
render file: "public/404.html", status: :not_found, layout: nil render file: "public/404.html", status: :not_found, layout: nil