mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 22:15:57 +03:00
Add deletion capability to sharecontroller
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
e52d6dfb23
commit
8b285a7ea9
1 changed files with 14 additions and 0 deletions
|
@ -54,4 +54,18 @@ class ShareController: ObservableObject {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func delete() async -> NKError? {
|
||||
Logger.shareController.info("Deleting share: \(self.share.url)")
|
||||
return await withCheckedContinuation { continuation in
|
||||
kit.deleteShare(idShare: share.idShare) { account, error in
|
||||
Logger.shareController.info("Received delete response: \(self.share.url)")
|
||||
defer { continuation.resume(returning: error) }
|
||||
guard error == .success else {
|
||||
Logger.shareController.error("Error deleting save: \(error.errorDescription)")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue