diff --git a/App/Sources/View Models/NewTaskViewModel.swift b/App/Sources/View Models/NewTaskViewModel.swift index 732c753..9b3fbef 100644 --- a/App/Sources/View Models/NewTaskViewModel.swift +++ b/App/Sources/View Models/NewTaskViewModel.swift @@ -57,14 +57,14 @@ extension NewTaskView { // MARK: Functions - /// Saves a new todo task to the SwiftData model context. + /// Saves a new todo task to the repository. /// - /// This function creates a new `Todo` instance with the current property values and inserts it into the provided model context. + /// This function creates a new `Todo` instance with the current property values and inserts it into the provided repository. /// The title and note are trimmed of leading and trailing whitespace before saving. /// The `note` property value is only included if it's not empty after trimming. /// - /// - Parameter modelContext: The SwiftData model context to insert a new todo task. - func save(to modelContext: ModelContext) { + /// - Parameter repository: The repository to insert a new todo task. + func save(to repository: Repository) { let trimmedTitle = title.trimmingCharacters(in: .whitespacesAndNewlines) let trimmedNote = note.trimmingCharacters(in: .whitespacesAndNewlines) @@ -74,7 +74,7 @@ extension NewTaskView { due: due ) - modelContext.insert(todo) + repository.insert(todo) } }