amended api for recurring transaction list

This commit is contained in:
Finn 2018-03-14 17:55:24 +00:00
parent 37ffd53054
commit bd36405fa8

View file

@ -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;