blob: bd949e3aa203b5682581d638cab11a799109a587 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package jitterbug::Task;
use Dancer ':syntax';
use Dancer::Plugin::DBIC;
use jitterbug::Plugin::Template;
get '/:id' => sub {
unless ( defined params->{id} ) {
send_error("task id missing!", 400);
return;
}
my $task = schema->resultset('Task')->find( params->{id} );
unless ( defined $task ) {
send_error("task does not exist!", 404);
return;
}
my $commit = from_json( $task->commit->content );
template 'task/index',
{
task => { id => $task->id, started_when => $task->started_when },
commit => $commit
};
};
1;
|