Revert "Decline from notification works!"

This reverts commit 5809b23811.
This commit is contained in:
brantje 2016-10-02 17:38:19 +02:00
Родитель 5809b23811
Коммит bd7fc18896
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5FF1D117F918687F
3 изменённых файлов: 4 добавлений и 24 удалений

Просмотреть файл

@ -182,18 +182,16 @@ class ShareController extends ApiController {
}
public function deleteShareRequest($share_request_id){
$sr = $this->shareService->getSharingRequestById($share_request_id);
$share_requests = $this->shareService->getShareRequestsByItemId($sr->getItemId());
foreach ($share_requests as $share_request){
$this->shareService->deleteShareRequestById($share_request->getId());
}
echo $share_request_id;
$manager = \OC::$server->getNotificationManager();
$notification = $manager->createNotification();
$notification->setApp('passman')
->setObject('passman_share_request', $share_request_id)
->setUser($this->userId->getUID());
$manager->markProcessed($notification);
return new JSONResponse(array('result'=>true));
//@TODO load other requests and delete them by item id.
$this->shareService->deleteShareRequestById($share_request_id);
}
}

Просмотреть файл

@ -57,14 +57,4 @@ class ShareRequestMapper extends Mapper {
public function deleteShareRequest(ShareRequest $shareRequest){
$this->delete($shareRequest);
}
public function getSharingRequestById($id){
$q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME . " WHERE id = ?";
return $this->findEntity($q, [$id]);
}
public function getShareRequestsByItemId($item_id){
$q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME . " WHERE item_id = ?";
return $this->findEntities($q, [$item_id]);
}
}

Просмотреть файл

@ -100,12 +100,4 @@ class ShareService {
$this->shareRequest->deleteShareRequest($t);
}
public function getSharingRequestById($id){
return $this->shareRequest->getSharingRequestById($id);
}
public function getShareRequestsByItemId($item_id){
return $this->shareRequest->getShareRequestsByItemId($item_id);
}
}