feat: Updates views to use new api controllers and db items.
This commit is contained in:
@@ -2,7 +2,7 @@ import Fluent
|
||||
import Vapor
|
||||
|
||||
struct VendorViewController: RouteCollection {
|
||||
private let api = ApiController()
|
||||
private let api = VendorApiController()
|
||||
|
||||
func boot(routes: any RoutesBuilder) throws {
|
||||
let vendors = routes.protected.grouped("vendors")
|
||||
@@ -44,12 +44,12 @@ struct VendorViewController: RouteCollection {
|
||||
|
||||
@Sendable
|
||||
func delete(req: Request) async throws -> HTTPStatus {
|
||||
try await api.deleteVendor(req: req)
|
||||
try await api.delete(req: req)
|
||||
}
|
||||
|
||||
@Sendable
|
||||
func update(req: Request) async throws -> View {
|
||||
_ = try await api.updateVendor(req: req)
|
||||
_ = try await api.update(req: req)
|
||||
return try await req.view.render("vendors/table", makeCtx(req: req, oob: true))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user