feat: Begins implementing route definitions.
This commit is contained in:
@@ -22,14 +22,12 @@ struct PurchaseOrderTable: HTML {
|
||||
|
||||
var content: some HTML {
|
||||
table(.id(.purchaseOrders())) {
|
||||
if page.items.count > 0 {
|
||||
thead {
|
||||
buttonRow
|
||||
tableHeader
|
||||
}
|
||||
tbody(.id(.purchaseOrders(.table))) {
|
||||
Rows(page: page)
|
||||
}
|
||||
thead {
|
||||
buttonRow
|
||||
tableHeader
|
||||
}
|
||||
tbody(.id(.purchaseOrders(.table))) {
|
||||
Rows(page: page)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import DatabaseClientLive
|
||||
import Dependencies
|
||||
import Fluent
|
||||
import FluentSQLiteDriver
|
||||
import Leaf
|
||||
import NIOSSL
|
||||
import SharedModels
|
||||
import Vapor
|
||||
@@ -45,8 +44,11 @@ public func configure(_ app: Application) async throws {
|
||||
try routes(app)
|
||||
}
|
||||
|
||||
if app.environment != .production {
|
||||
try await app.autoMigrate()
|
||||
// if app.environment != .production {
|
||||
try await app.autoMigrate()
|
||||
// }
|
||||
|
||||
#if DEBUG
|
||||
app.asyncCommands.use(SeedCommand(), as: "seed")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ func routes(_ app: Application) throws {
|
||||
}
|
||||
}
|
||||
|
||||
app.get("health") { _ in
|
||||
HTTPStatus.ok
|
||||
}
|
||||
|
||||
app.post("login") { req in
|
||||
@Dependency(\.database.users) var users
|
||||
let loginForm = try req.content.decode(User.Login.self)
|
||||
|
||||
Reference in New Issue
Block a user