Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `Gemfile.lock`: Not a real conflict, just an upstream dependency udpated textually too close to a glitch-soc-only dependency. Updated dependencies like upstream. - `app/controllers/settings/preferences_controller.rb`: Upstream added settings where we had extra glitch-soc-specific settings. Added upstream's new settings. - `app/models/user.rb`: Upstream added settings where we had extra glitch-soc-specific settings. Added upstream's new settings. - `config/i18n-tasks.yml`: Not a real conflict, just a new upstream line too textually close to a glitch-soc-only line. Ported upstream's change.
This commit is contained in:
@ -65,8 +65,9 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
||||
|
||||
def destroy
|
||||
authorize @account, :destroy?
|
||||
json = render_to_body json: @account, serializer: REST::Admin::AccountSerializer
|
||||
Admin::AccountDeletionWorker.perform_async(@account.id)
|
||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||
render json: json
|
||||
end
|
||||
|
||||
def unsensitive
|
||||
|
@ -79,10 +79,12 @@ class Api::V1::StatusesController < Api::BaseController
|
||||
authorize @status, :destroy?
|
||||
|
||||
@status.discard
|
||||
RemovalWorker.perform_async(@status.id, { 'redraft' => true })
|
||||
@status.account.statuses_count = @status.account.statuses_count - 1
|
||||
json = render_to_body json: @status, serializer: REST::StatusSerializer, source_requested: true
|
||||
|
||||
render json: @status, serializer: REST::StatusSerializer, source_requested: true
|
||||
RemovalWorker.perform_async(@status.id, { 'redraft' => true })
|
||||
|
||||
render json: json
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -36,13 +36,17 @@ class Api::V1::Trends::LinksController < Api::BaseController
|
||||
end
|
||||
|
||||
def next_path
|
||||
api_v1_trends_links_url pagination_params(offset: offset_param + limit_param(DEFAULT_LINKS_LIMIT))
|
||||
api_v1_trends_links_url pagination_params(offset: offset_param + limit_param(DEFAULT_LINKS_LIMIT)) if records_continue?
|
||||
end
|
||||
|
||||
def prev_path
|
||||
api_v1_trends_links_url pagination_params(offset: offset_param - limit_param(DEFAULT_LINKS_LIMIT)) if offset_param > limit_param(DEFAULT_LINKS_LIMIT)
|
||||
end
|
||||
|
||||
def records_continue?
|
||||
@links.size == limit_param(DEFAULT_LINKS_LIMIT)
|
||||
end
|
||||
|
||||
def offset_param
|
||||
params[:offset].to_i
|
||||
end
|
||||
|
@ -36,7 +36,7 @@ class Api::V1::Trends::StatusesController < Api::BaseController
|
||||
end
|
||||
|
||||
def next_path
|
||||
api_v1_trends_statuses_url pagination_params(offset: offset_param + limit_param(DEFAULT_STATUSES_LIMIT))
|
||||
api_v1_trends_statuses_url pagination_params(offset: offset_param + limit_param(DEFAULT_STATUSES_LIMIT)) if records_continue?
|
||||
end
|
||||
|
||||
def prev_path
|
||||
@ -46,4 +46,8 @@ class Api::V1::Trends::StatusesController < Api::BaseController
|
||||
def offset_param
|
||||
params[:offset].to_i
|
||||
end
|
||||
|
||||
def records_continue?
|
||||
@statuses.size == limit_param(DEFAULT_STATUSES_LIMIT)
|
||||
end
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ class Api::V1::Trends::TagsController < Api::BaseController
|
||||
end
|
||||
|
||||
def next_path
|
||||
api_v1_trends_tags_url pagination_params(offset: offset_param + limit_param(DEFAULT_TAGS_LIMIT))
|
||||
api_v1_trends_tags_url pagination_params(offset: offset_param + limit_param(DEFAULT_TAGS_LIMIT)) if records_continue?
|
||||
end
|
||||
|
||||
def prev_path
|
||||
@ -42,4 +42,8 @@ class Api::V1::Trends::TagsController < Api::BaseController
|
||||
def offset_param
|
||||
params[:offset].to_i
|
||||
end
|
||||
|
||||
def records_continue?
|
||||
@tags.size == limit_param(DEFAULT_TAGS_LIMIT)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user