Add swipe action to rename cap

This commit is contained in:
Christoph Hagen
2022-12-11 19:26:11 +01:00
parent b767301aa0
commit 25aadffa51
2 changed files with 56 additions and 0 deletions

View File

@ -394,6 +394,17 @@ final class Database: ObservableObject {
}
return true
}
func update(name: String, for capId: Int) -> Bool {
guard var cap = caps[capId] else {
log("Failed to update name for missing cap \(capId)")
return false
}
cap.name = name
caps[capId] = cap
changedCaps.insert(capId)
return true
}
// MARK: Uploads