diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2019-02-15 19:32:17 +0100 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2019-02-15 19:32:17 +0100 | 
| commit | e297bd94136bacbdde8d55f24972d4a37302cbea (patch) | |
| tree | 09984bca9d54cfae9a50310620aaf7d1912ab76c | |
| parent | af1e1a8294abce86371dc67fe494ffdd01fefa05 (diff) | |
perltidy
| -rwxr-xr-x | index.pl | 26 | 
1 files changed, 13 insertions, 13 deletions
| @@ -315,20 +315,20 @@ helper 'undo' => sub {  	$self->app->get_last_actions_query->execute($uid);  	my $rows = $self->app->get_last_actions_query->fetchall_arrayref; -	if ( @{$rows} and $rows->[0][0] == $action_type{undo}) { +	if ( @{$rows} and $rows->[0][0] == $action_type{undo} ) {  		return 'Nested undo (undoing an undo) is not supported';  	} -	if ( @{$rows} > 1 and $rows->[1][0] == $action_type{undo}) { +	if ( @{$rows} > 1 and $rows->[1][0] == $action_type{undo} ) {  		return 'Repeated undo is not supported';  	} -	my $success = $self->app->undo_query->execute( -		$self->get_user_id, +	my $success +	  = $self->app->undo_query->execute( $self->get_user_id,  		DateTime->now( time_zone => 'Europe/Berlin' )->epoch, -	); +	  ); -	if (defined $success) { +	if ( defined $success ) {  		return;  	}  	else { @@ -558,9 +558,9 @@ helper 'get_user_status' => sub {  	if ( @{$rows} ) {  		my $now = DateTime->now( time_zone => 'Europe/Berlin' ); -		my @cols = @{$rows->[0]}; -		if (@{$rows} > 2 and $rows->[0][0] == $action_type{undo}) { -			@cols = @{$rows->[2]}; +		my @cols = @{ $rows->[0] }; +		if ( @{$rows} > 2 and $rows->[0][0] == $action_type{undo} ) { +			@cols = @{ $rows->[2] };  		}  		my $ts = epoch_to_dt( $cols[1] ); @@ -650,9 +650,9 @@ post '/action' => sub {  	if ( not $params->{action} ) {  		$self->render( -			json   => { +			json => {  				success => 0, -				error => 'Missing action value', +				error   => 'Missing action value',  			},  			status => 400,  		); @@ -721,9 +721,9 @@ post '/action' => sub {  	}  	else {  		$self->render( -			json   => { +			json => {  				success => 0, -				error => 'invalid action value', +				error   => 'invalid action value',  			},  			status => 400,  		); | 
