Reenable Twitter/Destroy tests

This commit is contained in:
Philipp 2021-12-09 21:03:33 +01:00
parent 354c2d828a
commit 4d330f2876
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 24 additions and 11 deletions

View file

@ -26,6 +26,7 @@ use Friendica\Module\BaseApi;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Network\HTTPException\BadRequestException;
/**
* Destroys a specific status.
@ -39,10 +40,12 @@ class Destroy extends BaseApi
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
if (empty($this->parameters['id'])) {
$id = intval($request['id'] ?? 0);
} else {
if (empty($this->parameters['id']) && !empty($request['id'])) {
$id = intval($request['id']);
} elseif (!empty($this->parameters['id'])) {
$id = (int)$this->parameters['id'];
} else {
throw new BadRequestException('An id is missing.');
}
$this->logger->notice('API: api_statuses_destroy: ' . $id);