diff --git a/app/controllers/api/statistiques_controller.rb b/app/controllers/api/statistiques_controller.rb deleted file mode 100644 index d8c555040..000000000 --- a/app/controllers/api/statistiques_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -class API::StatistiquesController < ApplicationController - def dossiers_stats - render json: { - total: total_dossiers, - mois: dossiers_mois - } - end - - private - - def total_dossiers - Dossier.state_not_brouillon.size - end - - def dossiers_mois - Dossier.state_not_brouillon.where(created_at: (1.month.ago)..Time.now).size - end -end diff --git a/config/routes.rb b/config/routes.rb index 52daa11db..78247d329 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -261,10 +261,6 @@ Rails.application.routes.draw do resources :dossiers, only: [:index, :show] end end - - namespace :statistiques do - get 'dossiers' => '/api/statistiques#dossiers_stats' - end end # diff --git a/spec/controllers/api/statistiques_spec.rb b/spec/controllers/api/statistiques_spec.rb deleted file mode 100644 index fa04982ad..000000000 --- a/spec/controllers/api/statistiques_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'spec_helper' - -describe API::StatistiquesController, type: :controller do - describe '#GET dossiers_stats' do - before do - get :dossiers_stats - end - - it { expect(response.status).to eq 200 } - end -end