Fix id of Items, saving
This commit is contained in:
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user