mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-10 21:46:25 +08:00
Fix Call to a member function getId() on array (Fixes #252)
This commit is contained in:
parent
e5e8170cfa
commit
dca12aee07
2 changed files with 9 additions and 21 deletions
|
@ -292,7 +292,7 @@ class CredentialController extends ApiController {
|
||||||
'', $this->userId, Activity::TYPE_ITEM_ACTION);
|
'', $this->userId, Activity::TYPE_ITEM_ACTION);
|
||||||
$this->sharingService->unshareCredential($credential->getGuid());
|
$this->sharingService->unshareCredential($credential->getGuid());
|
||||||
foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) {
|
foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) {
|
||||||
$id = $revision->getId();
|
$id = $revision['revision_id'];
|
||||||
if(isset($id)){
|
if(isset($id)){
|
||||||
$this->credentialRevisionService->deleteRevision($id, $this->userId);
|
$this->credentialRevisionService->deleteRevision($id, $this->userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,17 +262,10 @@
|
||||||
if (notification) {
|
if (notification) {
|
||||||
NotificationService.hideNotification(notification);
|
NotificationService.hideNotification(notification);
|
||||||
}
|
}
|
||||||
notification = NotificationService.showNotification($translate.instant('credential.deleted'), 5000,
|
var key = CredentialService.getSharedKeyFromCredential(_credential);
|
||||||
function () {
|
CredentialService.updateCredential(_credential, false, key).then(function (result) {
|
||||||
var key = CredentialService.getSharedKeyFromCredential(_credential);
|
notification = NotificationService.showNotification($translate.instant('credential.deleted'), 5000);
|
||||||
CredentialService.updateCredential(_credential, false, key).then(function (result) {
|
});
|
||||||
if (result.delete_time > 0) {
|
|
||||||
notification = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.recoverCredential = function (credential) {
|
$scope.recoverCredential = function (credential) {
|
||||||
|
@ -292,15 +285,10 @@
|
||||||
if (notification) {
|
if (notification) {
|
||||||
NotificationService.hideNotification(notification);
|
NotificationService.hideNotification(notification);
|
||||||
}
|
}
|
||||||
NotificationService.showNotification($translate.instant('credential.recovered'), 5000,
|
var key = CredentialService.getSharedKeyFromCredential(_credential);
|
||||||
function () {
|
CredentialService.updateCredential(_credential, false, key).then(function () {
|
||||||
var key = CredentialService.getSharedKeyFromCredential(_credential);
|
NotificationService.showNotification($translate.instant('credential.recovered'), 5000);
|
||||||
CredentialService.updateCredential(_credential, false, key).then(function () {
|
});
|
||||||
notification = false;
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.destroyCredential = function (credential) {
|
$scope.destroyCredential = function (credential) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue