diff --git a/lib/Pear/LocalLoop/Controller/Api/Transactions.pm b/lib/Pear/LocalLoop/Controller/Api/Transactions.pm index 9273c2d..8f4f2d0 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Transactions.pm @@ -45,12 +45,13 @@ sub post_transaction_list_purchases { my @recurring_transaction_list = ( map {{ + id => $_->id, seller => $_->seller->name, value => $_->value / 100000, start_time => $c->format_iso_datetime($_->start_time), last_updated => $c->format_iso_datetime($_->last_updated), essential => $_->essential, - category => $_->category->category->name, + category => ( defined $_->category ? $_->category->name : 'Uncategorised' ), recurring_period => $_->recurring_period, }} $recurring_transactions->all ); @@ -63,4 +64,16 @@ sub post_transaction_list_purchases { }); } +sub update_recurring { + my $c = shift; + + my $user = $c->stash->{api_user}; + + my $validation = $c->validation; + + $validation->input( $c->stash->{api_json} ); + #TODO check that user matches seller on database before updating for that id + +} + 1;