Add source editing to ingest
All checks were successful
CI / build-and-deploy (push) Successful in 25s
All checks were successful
CI / build-and-deploy (push) Successful in 25s
This commit is contained in:
@@ -43,6 +43,15 @@ final class IngestedSourceLibrary {
|
||||
}
|
||||
}
|
||||
|
||||
func update(_ source: IngestedSource, title: String, bodyText: String, tags: [String]) {
|
||||
var updated = source
|
||||
updated.title = title.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
updated.bodyText = bodyText.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
updated.tags = tags
|
||||
updated.modifiedAt = Date()
|
||||
upsert(updated)
|
||||
}
|
||||
|
||||
func delete(_ source: IngestedSource) {
|
||||
do {
|
||||
try store.delete(source)
|
||||
|
||||
Reference in New Issue
Block a user