FIX: Allow customized usernames to work in this route

Co-authored-by: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
Robin Ward 2018-02-21 13:37:14 -05:00
parent 23f7c3607c
commit 83d8fa2892

View File

@ -293,10 +293,11 @@ class ListController < ApplicationController
def page_params(opts = nil) def page_params(opts = nil)
opts ||= {} opts ||= {}
route_params = { format: 'json' } route_params = { format: 'json' }
route_params[:category] = @category.slug_for_url if @category route_params[:category] = @category.slug_for_url if @category
route_params[:parent_category] = @category.parent_category.slug_for_url if @category && @category.parent_category route_params[:parent_category] = @category.parent_category.slug_for_url if @category && @category.parent_category
route_params[:order] = opts[:order] if opts[:order].present? route_params[:order] = opts[:order] if opts[:order].present?
route_params[:ascending] = opts[:ascending] if opts[:ascending].present? route_params[:ascending] = opts[:ascending] if opts[:ascending].present?
route_params[:username] = UrlHelper.escape_uri(params[:username]) if params[:username].present?
route_params route_params
end end