<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
{
protected function post(array $request = [])
{
- self::checkAllowedScope(self::SCOPE_WRITE);
+ $this->checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
if (empty($this->parameters['id'])) {
- DI::mstdnError()->UnprocessableEntity();
+ $this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity());
}
- $Notification = DI::notification()->selectOneForUser($uid, $this->parameters['id']);
- $Notification->setSeen();
+ $condition = ['id' => $this->parameters['id']];
+ $Notification = DI::notification()->selectOneForUser($uid, $condition);
+ $Notification->setDismissed();
DI::notification()->save($Notification);
- System::jsonExit([]);
+ $this->jsonExit([]);
}
}