Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client Delete API Minor fix #317

Merged
merged 1 commit into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/internal_api/v1/clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class InternalApi::V1::ClientsController < InternalApi::V1::ApplicationController
def index
authorize Client
query = current_company.clients.ransack({ name_or_email_cont: params[:q] })
query = current_company.clients.kept.ransack({ name_or_email_cont: params[:q] })
clients = query.result(distinct: true)
client_details = clients.map { |client| client.client_detail(params[:time_frame]) }
total_minutes = (client_details.map { |client| client[:minutes_spent] }).sum
Expand Down
2 changes: 1 addition & 1 deletion app/views/internal_api/v1/projects/index.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ json.projects projects do |project|
json.is_billable project.billable
json.minutes_spent project.total_hours_logged
end
json.clients current_company.clients do |client|
json.clients current_company.clients.kept do |client|
json.id client.id
json.name client.name
end