feat: working on detail views.
This commit is contained in:
@@ -20,7 +20,7 @@ struct EmployeeApiController: RouteCollection {
|
||||
@Sendable
|
||||
func index(req: Request) async throws -> [Employee.DTO] {
|
||||
let params = try req.query.decode(EmployeesIndexQuery.self)
|
||||
return try await employees.fetchAll(params.active ?? false)
|
||||
return try await employees.fetchAll(params.active == true ? .active : .default)
|
||||
}
|
||||
|
||||
@Sendable
|
||||
|
||||
@@ -31,7 +31,7 @@ struct VendorBranchApiController: RouteCollection {
|
||||
guard let id = req.parameters.get("vendorID", as: Vendor.IDValue.self) else {
|
||||
throw Abort(.badRequest, reason: "Vendor id not provided.")
|
||||
}
|
||||
return try await vendorBranches.fetchForVendor(id)
|
||||
return try await vendorBranches.fetchAll(.for(vendorID: id))
|
||||
}
|
||||
|
||||
@Sendable
|
||||
|
||||
Reference in New Issue
Block a user