DEV: Deprecate unused route instead of removing it. (#14030)

We'll no longer use this route, so we'll return a 301 with the new URL just in case someone is still using it.
This commit is contained in:
Roman Rizzi
2021-08-12 15:54:14 -03:00
committed by GitHub
parent 65f6d46045
commit 54ad0ecc72
2 changed files with 8 additions and 0 deletions

View File

@ -554,6 +554,13 @@ class PostsController < ApplicationController
render body: nil
end
def flagged_posts
deprecate('posts#flagged_posts is deprecated. Please use /review instead.', since: '2.8.0.beta4', drop_from: '2.9')
review_queue_url = path("/review?status=all&type=ReviewableFlaggedPost&username=#{params[:username]}")
redirect_to review_queue_url, status: 301
end
def deleted_posts
params.permit(:offset, :limit)
guardian.ensure_can_see_deleted_posts!