English grammar
This commit is contained in:
parent
2fac6bdb48
commit
a4ab27741c
|
@ -46,7 +46,7 @@ extension CrudControllerProtocol where ModelT: Replaceable {
|
|||
internal func replace(_ id: ModelT.IDValue?, from data: ModelT.Replace, on database: Database) -> EventLoopFuture<ModelT> {
|
||||
ModelT.find(id, on: database).unwrap(or: Abort(.notFound))
|
||||
.flatMap { model in
|
||||
model.replace(from: data)
|
||||
model.replace(with: data)
|
||||
return model.update(on: database).map { model }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@ import Vapor
|
|||
|
||||
public protocol Replaceable {
|
||||
associatedtype Replace: Content
|
||||
func replace(from data: Replace)
|
||||
func replace(with data: Replace)
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ extension Todo: Replaceable {
|
|||
var title: String
|
||||
}
|
||||
|
||||
func replace(from data: Replace) {
|
||||
func replace(with data: Replace) {
|
||||
self.title = data.title
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue