From 4053d8dc95a1a3d631e7d4b47190e897ef1f5a10 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 16 Oct 2014 22:16:11 +0200 Subject: [PATCH] Cleanups in delete_room --- vroom.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vroom.pl b/vroom.pl index 3c6ed76..4d89ed5 100755 --- a/vroom.pl +++ b/vroom.pl @@ -479,7 +479,7 @@ helper delete_room => sub { my $data = $self->get_room_by_name($room); if (!$data){ $self->app->log->debug("Error: room $room doesn't exist"); - return undef; + return 0; } if ($ec && $data->{etherpad_group}){ $ec->delete_pad($data->{etherpad_group} . '$' . $room); @@ -487,9 +487,9 @@ helper delete_room => sub { } my $sth = eval { $self->db->prepare('DELETE FROM `rooms` - WHERE `id`=?'); - } || return undef; - $sth->execute($data->{id}) || return undef; + WHERE `name`=?'); + }; + $sth->execute($room); return 1; };