projects
/
app-web-oof.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5eeddbd
)
Show an error if a nonexistent order is viewed
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 5 Mar 2016 18:18:56 +0000
(18:18 +0000)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 5 Mar 2016 18:18:56 +0000
(18:18 +0000)
lib/App/Web/Oof.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/App/Web/Oof.pm
b/lib/App/Web/Oof.pm
index 2814ad3760b879b85193982019d69e91cb2b79e1..93ab4fe40d62e3096a8d9dae9cef2b947897a581 100644
(file)
--- a/
lib/App/Web/Oof.pm
+++ b/
lib/App/Web/Oof.pm
@@
-164,7
+164,8
@@
sub order_app {
my $req = Plack::Request->new($env);
my ($id) = $env->{PATH_INFO} =~ m,^/([0-9A-F]+),;
if ($id) {
my $req = Plack::Request->new($env);
my ($id) = $env->{PATH_INFO} =~ m,^/([0-9A-F]+),;
if ($id) {
- my $total = $db{$$}->select(orders => 'total', {id => $id})->list;
+ my $total = $db{$$}->select(orders => 'total', {id => $id})->list or
+ return [500, ['Content-type', 'text/plain'], ['Order not found']];
$tree->fid('orderid')->replace_content($id);
$tree->look_down(name => 'order')->attr(value => $id);
$tree->fid('total')->replace_content(stringify_money $total);
$tree->fid('orderid')->replace_content($id);
$tree->look_down(name => 'order')->attr(value => $id);
$tree->fid('total')->replace_content(stringify_money $total);
This page took
0.010737 seconds
and
4
git commands to generate.