feat: Starting users view controller.

This commit is contained in:
2025-01-08 08:02:29 -05:00
parent e86e5facc6
commit 3557227430
5 changed files with 83 additions and 30 deletions

View File

@@ -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))
}