summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/ULists.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-12-07 12:30:46 +0100
committerYorhel <git@yorhel.nl>2008-12-07 12:30:46 +0100
commit22fcb9d63cb265a89aec31521084dad605f64228 (patch)
tree39c7f54f1b2ecf411d9143163935eb6e5faf8fe5 /lib/VNDB/Handler/ULists.pm
parentb5d73e4a9d7df30320b23d07ef62cf78167e71db (diff)
Modify wishlist from VN pages
Diffstat (limited to 'lib/VNDB/Handler/ULists.pm')
-rw-r--r--lib/VNDB/Handler/ULists.pm21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm
index 2da69d51..3a715fcf 100644
--- a/lib/VNDB/Handler/ULists.pm
+++ b/lib/VNDB/Handler/ULists.pm
@@ -6,7 +6,8 @@ use warnings;
YAWF::register(
- qr{v([1-9]\d*)/vote}, \&vnvote
+ qr{v([1-9]\d*)/vote}, \&vnvote,
+ qr{v([1-9]\d*)/wish}, \&vnwish,
);
@@ -28,5 +29,23 @@ sub vnvote {
}
+sub vnwish {
+ my($self, $id) = @_;
+
+ my $uid = $self->authInfo->{id};
+ return $self->htmlDenied() if !$uid;
+
+ my $f = $self->formValidate(
+ { name => 's', enum => [ -1..$#{$self->{wishlist_status}} ] }
+ );
+ return 404 if $f->{_err};
+
+ $self->dbWishListDel($uid, $id) if $f->{s} == -1;
+ $self->dbWishListAdd($id, $uid, $f->{s}) if $f->{s} != -1;
+
+ $self->resRedirect('/v'.$id, 'temp');
+}
+
+
1;