Remove some obsolete JSON APIs

This commit is contained in:
Eelco Dolstra
2013-10-03 14:50:56 +02:00
parent c8e5faf81e
commit adcdfcde6b
3 changed files with 2 additions and 42 deletions

View File

@ -15,8 +15,6 @@ use Digest::SHA qw(sha256_hex);
use Text::Diff;
use File::Slurp;
# !!! Rewrite this to use View::JSON.
sub api : Chained('/') PathPart('api') CaptureArgs(0) {
my ($self, $c) = @_;
@ -24,32 +22,6 @@ sub api : Chained('/') PathPart('api') CaptureArgs(0) {
}
sub projectToHash {
my ($project) = @_;
return {
name => $project->name,
description => $project->description
};
}
sub projects : Chained('api') PathPart('projects') Args(0) {
my ($self, $c) = @_;
my @projects = $c->model('DB::Projects')->search({hidden => 0}, {order_by => 'name'});
my @list;
foreach my $p (@projects) {
push @list, projectToHash($p);
}
$c->stash->{'plain'} = {
data => scalar (JSON::Any->objToJson(\@list))
};
$c->forward('Hydra::View::Plain');
}
sub buildToHash {
my ($build) = @_;
my $result = {