feat: Adds employee form and table view, begins user form and table view.

This commit is contained in:
2025-01-07 14:05:40 -05:00
parent e3f150b32c
commit 08a0a8e1a3
15 changed files with 366 additions and 93 deletions

View File

@@ -30,6 +30,7 @@ struct ApiController: RouteCollection {
purchaseOrders.get(use: purchaseOrdersIndex(req:))
purchaseOrders.post(use: createPurchaseOrder(req:))
users.get(use: usersIndex(req:))
users.post(use: createUser(req:))
users.group("login") {
$0.get(use: self.login(req:))
@@ -168,6 +169,11 @@ struct ApiController: RouteCollection {
return token
}
@Sendable
func usersIndex(req: Request) async throws -> [User.DTO] {
try await User.query(on: req.db).all().map { $0.toDTO() }
}
// MARK: - Vendors
@Sendable