mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 07:56:23 +00:00
Return current start as last_id if last_id = 0
This commit is contained in:
parent
7fda438397
commit
467565d41b
@ -195,7 +195,7 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
$messages = $this->smsMapper->getMessages($this->userId, $start, $limit);
|
||||
$last_id = 0;
|
||||
$last_id = $start;
|
||||
if (count($messages) > 0) {
|
||||
$last_id = max(array_keys($messages));
|
||||
}
|
||||
@ -219,7 +219,7 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
// @TODO because multiple phone numbers can be same number with different formatting
|
||||
return new JSONResponse(array("messages" => array(), "last_id" => 0));
|
||||
return new JSONResponse(array("messages" => array(), "last_id" => $start));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user