Remove the now useless stats API

This commit is contained in:
gregoirenovel 2018-08-29 14:41:17 +02:00
parent 85105ea156
commit 0ac160c824
3 changed files with 0 additions and 33 deletions

View file

@ -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

View file

@ -261,10 +261,6 @@ Rails.application.routes.draw do
resources :dossiers, only: [:index, :show] resources :dossiers, only: [:index, :show]
end end
end end
namespace :statistiques do
get 'dossiers' => '/api/statistiques#dossiers_stats'
end
end end
# #

View file

@ -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