Skip to content

Instantly share code, notes, and snippets.

@simcop2387
Created February 6, 2011 00:43
Show Gist options
  • Save simcop2387/812974 to your computer and use it in GitHub Desktop.
Save simcop2387/812974 to your computer and use it in GitHub Desktop.
package Site::Pages::AJAJ::Lists::Delete;
use strictures 1;
use base qw/ Site::Pages::JSON /;
sub handle_POST {
my ( $self ) = @_;
my ( $uid ) = $self->unroll_session();
my $data = $self->get_json('data');
my ($id) = $data->{id};
if (my $list = $self->schema->resultset('List')->find({lid => $id})) {
$list->delete();
return $self->json_success;
} else {
return $self->json_failure;
}
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment