Fix id of Items, saving

This commit is contained in:
Christoph Hagen
2025-06-11 08:19:44 +02:00
parent 5970ce2e9f
commit 1d0eba9d78
64 changed files with 233 additions and 217 deletions

View File

@@ -7,19 +7,19 @@ extension Content {
private static let disallowedCharactersInFileIds = CharacterSet.alphanumerics.union(CharacterSet(charactersIn: "-.")).inverted
func isNewIdForTag(_ id: String) -> Bool {
tagOverview?.id != id && !tags.contains { $0.id == id }
tagOverview?.identifier != id && !tags.contains { $0.identifier == id }
}
func isNewIdForPage(_ id: String) -> Bool {
!pages.contains { $0.id == id }
!pages.contains { $0.identifier == id }
}
func isNewIdForPost(_ id: String) -> Bool {
!posts.contains { $0.id == id }
!posts.contains { $0.identifier == id }
}
func isNewIdForFile(_ id: String) -> Bool {
!files.contains { $0.id == id }
!files.contains { $0.identifier == id }
}
func isValidIdForTagOrPageOrPost(_ id: String) -> Bool {