Skip to content

Commit

Permalink
client delete fix (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketkaushik authored Apr 22, 2022
1 parent fa5b2d4 commit 80388b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 80388b7

Please sign in to comment.