Changeset 1817

Show
Ignore:
Timestamp:
05/10/06 02:25:13
Author:
miyagawa
Message:

support api/all

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PlaggerLDR/trunk/lib/PlaggerLDR/Controller/API.pm

    r1816 r1817  
    6161    }; 
    6262 
     63    my @terms = $c->stash->{is_all} 
     64        ? (undef, { order_by => 'id DESC', 
     65                    rows => 20, 
     66                    page => $c->req->param('offset') / 20 + 1 }) 
     67        : ({ read => 0 }); 
     68 
    6369    my @items; 
    64     for my $entry ( $feed->entries({ read => 0 }) ) { 
     70    for my $entry ( $feed->entries(@terms) ) { 
    6571        push @items, { 
    6672            link => $entry->link, 
     
    7985 
    8086    $c->stash->{json} = $data; 
     87} 
     88 
     89sub all : Local { 
     90    my($self, $c) = @_; 
     91    $c->stash->{is_all} = 1; 
     92    $c->forward('unread'); 
    8193} 
    8294