Import old content, load from disk
This commit is contained in:
@@ -55,17 +55,15 @@ struct PostList: View {
|
||||
}
|
||||
|
||||
private func addNewPost() {
|
||||
let largestId = posts.map { $0.id }.max() ?? 0
|
||||
|
||||
let post = Post(
|
||||
id: largestId + 1,
|
||||
id: "new",
|
||||
isDraft: true,
|
||||
createdDate: .now,
|
||||
startDate: .now,
|
||||
endDate: nil,
|
||||
title: .init(en: "Title", de: "Titel"),
|
||||
text: .init(en: "Text", de: "Text"),
|
||||
tags: [],
|
||||
images: [])
|
||||
german: .init(title: "Titel", content: "Text"),
|
||||
english: .init(title: "Title", content: "Text"))
|
||||
posts.insert(post, at: 0)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user