/**
* @inheritdoc
* Fix Yii2 Bug #5665: The `currentPage` meta data in the RESTful result should be 1-based, similar to that in HTTP headers
* There is a similar fix in backend\components\rest\RestController.php
*/
public function afterAction($action, $result)
{
$result = parent::afterAction($action, $result);
$fixActions = ['message-history'];
if (in_array($action->id, $fixActions) && isset($result['_meta']['currentPage'])) {
$result['_meta']['currentPage']++;
}
return $result;
}