Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #61 from nodes-vapor/feature/validatable-update-re…
Browse files Browse the repository at this point in the history
…quest

Use Validatable's conformance for UpdateRequest
  • Loading branch information
siemensikkema committed Nov 6, 2020
2 parents 4072307 + d15bf65 commit 07d14bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Submissions/UpdateRequest.swift
Expand Up @@ -37,3 +37,9 @@ public extension UpdateRequest where Model: Authenticatable {
request.eventLoop.future(result: .init { try request.auth.require() })
}
}

public extension UpdateRequest where Self: Validatable {
static func validations(for _: Model, on request: Request) -> EventLoopFuture<Validations> {
request.eventLoop.future(validations())
}
}

0 comments on commit 07d14bf

Please sign in to comment.