feat: Starting users view controller.
This commit is contained in:
@@ -8,10 +8,7 @@ struct EmployeeViewController: RouteCollection {
|
||||
|
||||
func boot(routes: any RoutesBuilder) throws {
|
||||
let employees = routes.protected.grouped("employees")
|
||||
|
||||
// MARK: Protected routes.
|
||||
|
||||
employees.get(use: employees(req:))
|
||||
employees.get(use: index(req:))
|
||||
employees.get("form", use: employeeForm(req:))
|
||||
employees.post(use: postEmployeeForm(req:))
|
||||
employees.group(":employeeID") {
|
||||
@@ -23,7 +20,7 @@ struct EmployeeViewController: RouteCollection {
|
||||
}
|
||||
|
||||
@Sendable
|
||||
func employees(req: Request) async throws -> View {
|
||||
func index(req: Request) async throws -> View {
|
||||
return try await req.view.render("employees", EmployeesCTX(api: api, req: req))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user