feat: Moves database dependency directory.
This commit is contained in:
8
Sources/App/Extensions/Request+ensureValidContent.swift
Normal file
8
Sources/App/Extensions/Request+ensureValidContent.swift
Normal file
@@ -0,0 +1,8 @@
|
||||
import Vapor
|
||||
|
||||
extension Request {
|
||||
func ensureValidContent<T>(_ decoding: T.Type) throws -> T where T: Content, T: Validatable {
|
||||
try T.validate(content: self)
|
||||
return try content.decode(T.self)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user