sub job_list {
my ($self, %args) = @_;
$args{page} //= 1;
- my $rs = $self->jobs->search({contest => $args{contest}}, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner'], rows => JOBS_PER_PAGE, page => $args{page}});
+ my $rs = $self->jobs->search(undef, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner'], rows => JOBS_PER_PAGE, page => $args{page}});
+ $rs = $rs->search({contest => $args{contest} || undef}) if exists $args{contest};
$rs = $rs->search({'me.private'=> 0}) unless $args{private};
$rs = $rs->search({'me.owner' => $args{owner}}) if $args{owner};
$rs = $rs->search({problem => $args{problem}}) if $args{problem};