feat: Limit the number of custom filters per user (#7101)

This commit is contained in:
Tejaswini Chile
2023-05-22 18:03:15 +05:30
committed by GitHub
parent 68dedc37ba
commit d481b9fbcf
5 changed files with 31 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseContro
@custom_filter = current_user.custom_filters.create!(
permitted_payload.merge(account_id: Current.account.id)
)
render json: { error: @custom_filter.errors.messages }, status: :unprocessable_entity and return unless @custom_filter.valid?
end
def update