Skip to content

Commit

Permalink
Merge pull request #2681 from desaerun/patch-3
Browse files Browse the repository at this point in the history
add 'start' parameter to getusertransactions api page
  • Loading branch information
TheSerapher authored Mar 3, 2018
2 parents 02581f1 + 653729e commit 64c5c99
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/pages/api/getusertransactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
$user_id = $api->checkAccess($user->checkApiKey($_REQUEST['api_key']), @$_REQUEST['id']);

// Fetch transactions
if (isset($_REQUEST['start'])) {
$start = $_REQUEST['start'];
} else {
// start at the beginning
$start = 0;
}
if (isset($_REQUEST['limit']) && $_REQUEST['limit'] <= 100) {
$limit = $_REQUEST['limit'];
} else {
// Force limit
$limit = 100;
}
$data['transactions'] = $transaction->getTransactions(0, NULL, $limit, $user_id);

$data['transactions'] = $transaction->getTransactions($start, NULL, $limit, $user_id);

// Fetch summary if enabled
if (!$setting->getValue('disable_transactionsummary')) {
Expand Down

0 comments on commit 64c5c99

Please sign in to comment.