diff --git a/lib/topic_query.rb b/lib/topic_query.rb index f5cc2b4597b..202d3444704 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -35,7 +35,7 @@ class TopicQuery { max_posts: zero_up_to_max_int, min_posts: zero_up_to_max_int, - page: one_up_to_max_int, + page: zero_up_to_max_int, exclude_category_ids: array_int_or_int } end diff --git a/spec/requests/list_controller_spec.rb b/spec/requests/list_controller_spec.rb index 86d276af7ce..e494bebf579 100644 --- a/spec/requests/list_controller_spec.rb +++ b/spec/requests/list_controller_spec.rb @@ -30,9 +30,6 @@ RSpec.describe ListController do get "/latest?page=-1" expect(response.status).to eq(400) - get "/latest?page=0" - expect(response.status).to eq(400) - get "/latest?page=2147483648" expect(response.status).to eq(400) @@ -53,6 +50,9 @@ RSpec.describe ListController do get "/latest.json?min_posts=0" expect(response.status).to eq(200) + get "/latest?page=0" + expect(response.status).to eq(200) + get "/latest?page=1" expect(response.status).to eq(200)