Removed sector data API for customer

Should eventually be given to organisation dashboard
This commit is contained in:
Finn 2018-05-22 12:47:19 +01:00
parent 081274c78e
commit db71cab2d4

View file

@ -108,25 +108,6 @@ sub post_customer {
count => $count, 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 $data = { cat_total => {}, categories => {}, essentials => {}, cat_list => {} };
my $category_list = $c->schema->resultset('Category')->as_hash; my $category_list = $c->schema->resultset('Category')->as_hash;
@ -212,7 +193,6 @@ sub post_customer {
success => Mojo::JSON->true, success => Mojo::JSON->true,
data => $data, data => $data,
weeks => $weeks, weeks => $weeks,
sectors => $sectors,
}); });
} }