diff options
author | franck cuny <franck@lumberjaph.net> | 2011-05-09 09:38:31 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2011-05-09 16:42:15 +0200 |
commit | ec18b6e5b6d99cdf0566af2805092ad5bdda9085 (patch) | |
tree | fe0f241e8717003ce66fdc3d9d7a9f44ca1b5027 /lib/jitterbug/Task.pm | |
parent | implement some of #12 (diff) | |
download | jitterbug-ec18b6e5b6d99cdf0566af2805092ad5bdda9085.tar.gz |
show more informations about a task (closes GH #55)
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to 'lib/jitterbug/Task.pm')
-rw-r--r-- | lib/jitterbug/Task.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/jitterbug/Task.pm b/lib/jitterbug/Task.pm index 24366c1..b435de3 100644 --- a/lib/jitterbug/Task.pm +++ b/lib/jitterbug/Task.pm @@ -8,12 +8,19 @@ get '/:task_id' => sub { my $task_id = params->{task_id}; my $task = schema->resultset('Task')->find($task_id); + my $commit = + schema->resultset('Commit')->find( { sha256 => $task->sha256 } ); if (!$task) { send_error("task does not exist!", 404); } - template 'task/index', {task => $task }; + if (!$commit){ + render_error("commit doesn't exists", 404); + } + + my $content = from_json($commit->content); + template 'task/index', {task => $task, commit => $content }; }; 1; |