From 2b9cb8ca96c99342767978c1e672d4518fa5dc88 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 30 Oct 2023 08:52:49 +0100 Subject: [PATCH] (feat) change the param delted_user to including_deleted_users --- CHANGELOG.md | 2 +- app/controllers/open_api/v1/users_controller.rb | 2 +- app/doc/open_api/v1/users_doc.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8c907f06..adebc6335 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ - Fix a bug: fix all failing tasks of rake task file chain.rake - Fix a bug: file_size_validator.rb was broken since ruby v3, see https://github.com/rails/rails/issues/41270 - improvement: pre-registration event reservations ilimit places -- improvement: add deleted_user param for open api users +- improvement: add including_deleted_users param for open api users - decreases sidekiq concurrency from 25 to 5, 25 is too much and consumes memory for nothing - do not log Notifications#polling action anymore, by default, can be enable via env variable ENABLE_NOTIFICATIONS_POLLING_LOGGING=true diff --git a/app/controllers/open_api/v1/users_controller.rb b/app/controllers/open_api/v1/users_controller.rb index 4500d32cc..ad24798d9 100644 --- a/app/controllers/open_api/v1/users_controller.rb +++ b/app/controllers/open_api/v1/users_controller.rb @@ -9,7 +9,7 @@ class OpenAPI::V1::UsersController < OpenAPI::V1::BaseController def index @users = InvoicingProfile.order(created_at: :desc).includes(user: %i[group profile statistic_profile]) - @users = @users.where.not(user_id: nil) if params[:deleted_user].blank? + @users = @users.where.not(user_id: nil) if params[:including_deleted_users].blank? if params[:email].present? email_param = params[:email].is_a?(String) ? params[:email].downcase : params[:email].map(&:downcase) diff --git a/app/doc/open_api/v1/users_doc.rb b/app/doc/open_api/v1/users_doc.rb index ef1089052..7206f02d9 100644 --- a/app/doc/open_api/v1/users_doc.rb +++ b/app/doc/open_api/v1/users_doc.rb @@ -18,7 +18,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc param :email, [String, Array], optional: true, desc: 'Filter users by *email* using strict matching.' param :user_id, [Integer, Array], optional: true, desc: 'Filter users by *id* using strict matching.' param :created_after, DateTime, optional: true, desc: 'Filter users to accounts created after the given date.' - param :deleted_user, [true, false], optional: true, desc: 'Filter users to accounts deleted or not.' + param :including_deleted_users, [true, false], optional: true, desc: 'Filter users to accounts deleted or not.' example <<-USERS # /open_api/v1/users?page=1&per_page=4 {