Save and check page content automatically

This commit is contained in:
Christoph Hagen
2025-02-05 21:46:46 +01:00
parent 41171c31db
commit 7ebc9d8404
3 changed files with 105 additions and 48 deletions

View File

@ -77,6 +77,12 @@ final class Storage: ObservableObject {
return contentScope.write(pageContent, to: path)
}
func remove(pageContent pageId: String, in language: ContentLanguage) -> Bool {
guard let contentScope else { return false }
let path = pageContentPath(page: pageId, language: language)
return contentScope.deleteFile(at: path)
}
func save(page: Page.Data, for pageId: String) -> Bool {
guard let contentScope else { return false }
let path = pageMetadataPath(page: pageId)