Removed sector data API for customer
Should eventually be given to organisation dashboard
This commit is contained in:
parent
779a6e77ff
commit
6741aba746
1 changed files with 0 additions and 20 deletions
|
@ -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,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue