From db71cab2d4f1c6530a493d2464235940f0292ccc Mon Sep 17 00:00:00 2001 From: Finn Date: Tue, 22 May 2018 12:47:19 +0100 Subject: [PATCH] Removed sector data API for customer Should eventually be given to organisation dashboard --- lib/Pear/LocalLoop/Controller/Api/Stats.pm | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index 30c04b5..a467316 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -108,25 +108,6 @@ sub post_customer { count => $count, }; - my $sectors = { sectors => [], purchases => [] }; - - my $sector_purchase_rs = $purchase_rs->search({}, - { - join => { 'seller' => 'organisation' }, - columns => { - sector => "organisation.sector", - count => \"COUNT(*)", - }, - group_by => "organisation.sector", - order_by => { '-desc' => $c->pg_or_sqlite('count',"COUNT(*)",)}, - } - ); - - for ( $sector_purchase_rs->all ) { - push @{ $sectors->{ sectors } }, $_->get_column('sector'); - push @{ $sectors->{ purchases } }, ($_->get_column('count') || 0); - } - my $data = { cat_total => {}, categories => {}, essentials => {}, cat_list => {} }; my $category_list = $c->schema->resultset('Category')->as_hash; @@ -212,7 +193,6 @@ sub post_customer { success => Mojo::JSON->true, data => $data, weeks => $weeks, - sectors => $sectors, }); }