зеркало из https://github.com/nextcloud/passman.git
Revert "Decline from notification works!"
This reverts commit 5809b23811
.
This commit is contained in:
Родитель
5809b23811
Коммит
bd7fc18896
|
@ -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);
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче