feat: Adds employee form and table view, begins user form and table view.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user