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

@ -27,7 +27,7 @@ struct PagePickerView: View {
Text("Select a page to link to")
List(content.pages, selection: $newSelection) { page in
let loc = page.localized(in: language)
Text("\(loc.title) (\(page.id))")
Text("\(loc.title) (\(page.identifier))")
.tag(page)
}
.frame(minHeight: 300)

View File

@ -43,7 +43,7 @@ struct PostDetailView: View {
}
IdPropertyView(
id: $post.id,
id: $post.identifier,
footer: "The id is used to link to post and store them",
validation: post.isValid,
update: { post.update(id: $0) })
@ -99,8 +99,8 @@ struct PostDetailView: View {
}
private func deletePost() {
guard content.storage.delete(post: post.id) else {
print("Post '\(post.id)': Failed to delete file in content folder")
guard content.storage.delete(post: post.identifier) else {
print("Post '\(post.identifier)': Failed to delete file in content folder")
return
}
content.remove(post)

View File

@ -18,7 +18,7 @@ struct PostImageView: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 100)
Text(image.id)
Text(image.identifier)
.font(.title)
Text("Failed to load image")
.font(.body)
@ -32,7 +32,7 @@ struct PostImageView: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 100)
Text(image.id)
Text(image.identifier)
.font(.title)
Button("Generate preview") {
generateVideoPreview(image)
@ -48,7 +48,7 @@ struct PostImageView: View {
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 100)
Text(image.id)
Text(image.identifier)
.font(.title)
Text("Invalid media type")
.font(.body)

View File

@ -10,7 +10,7 @@ private struct PostListItem: View {
var body: some View {
HStack {
LocalizedPostListItem(id: post.id, post: post.localized(in: language))
LocalizedPostListItem(id: post.identifier, post: post.localized(in: language))
if post.isDraft {
TextIndicator(text: "Draft", background: .yellow)
} else {