Unified detail views, model
This commit is contained in:
@@ -66,9 +66,16 @@ final class Page: Item {
|
||||
super.init(content: content, id: id)
|
||||
}
|
||||
|
||||
func isValid(id: String) -> Bool {
|
||||
!id.isEmpty &&
|
||||
content.isValidIdForTagOrPageOrPost(id) &&
|
||||
content.isNewIdForPage(id)
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func update(id newId: String) -> Bool {
|
||||
guard content.storage.move(page: id, to: newId) else {
|
||||
print("Failed to move file of page \(id)")
|
||||
print("Failed to move files of page \(id)")
|
||||
return false
|
||||
}
|
||||
id = newId
|
||||
|
Reference in New Issue
Block a user