Fix irreversible and whole_word parameters handling in /api/v1/filters (#21988)
Fixes #21965
This commit is contained in:
parent
f80c3d40e8
commit
69137f4a90
3 changed files with 27 additions and 7 deletions
|
@ -13,7 +13,7 @@ class Api::V1::FiltersController < Api::BaseController
|
|||
|
||||
def create
|
||||
ApplicationRecord.transaction do
|
||||
filter_category = current_account.custom_filters.create!(resource_params)
|
||||
filter_category = current_account.custom_filters.create!(filter_params)
|
||||
@filter = filter_category.keywords.create!(keyword_params)
|
||||
end
|
||||
|
||||
|
@ -52,11 +52,11 @@ class Api::V1::FiltersController < Api::BaseController
|
|||
end
|
||||
|
||||
def resource_params
|
||||
params.permit(:phrase, :expires_in, :irreversible, context: [])
|
||||
params.permit(:phrase, :expires_in, :irreversible, :whole_word, context: [])
|
||||
end
|
||||
|
||||
def filter_params
|
||||
resource_params.slice(:expires_in, :irreversible, :context)
|
||||
resource_params.slice(:phrase, :expires_in, :irreversible, :context)
|
||||
end
|
||||
|
||||
def keyword_params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue