Move System::jsonError to BaseModule->jsonError

- This will ensure headers set in BaseModule->run will be carried in jsonError scenarios
- Make BaseApi->checkThrottleLimit an object method to use BaseModule->jsonError
- Deprecate jsonError() method in Core\System
This commit is contained in:
Hypolite Petovan 2023-09-21 12:27:15 -04:00
parent 81279dad9e
commit 46180d7d5b
11 changed files with 48 additions and 26 deletions

View file

@ -144,7 +144,7 @@ class Friendica extends BaseModule
header('Cache-Control: max-age=23200, stale-while-revalidate=23200');
$this->jsonExit($data, 'application/activity+json');
} catch (HTTPException\NotFoundException $e) {
System::jsonError(404, ['error' => 'Record not found']);
$this->jsonError(404, ['error' => 'Record not found']);
}
}