feat: Adds equipment info to database and api routes.
This commit is contained in:
@@ -15,20 +15,23 @@ public struct DatabaseClient: Sendable {
|
||||
public var migrations: Migrations
|
||||
public var projects: Projects
|
||||
public var rooms: Rooms
|
||||
public var equipment: Equipment
|
||||
}
|
||||
|
||||
extension DatabaseClient: TestDependencyKey {
|
||||
public static let testValue: DatabaseClient = Self(
|
||||
migrations: .testValue,
|
||||
projects: .testValue,
|
||||
rooms: .testValue
|
||||
rooms: .testValue,
|
||||
equipment: .testValue
|
||||
)
|
||||
|
||||
public static func live(database: any Database) -> Self {
|
||||
.init(
|
||||
migrations: .liveValue,
|
||||
projects: .live(database: database),
|
||||
rooms: .live(database: database)
|
||||
rooms: .live(database: database),
|
||||
equipment: .live(database: database)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -48,6 +51,7 @@ extension DatabaseClient.Migrations: DependencyKey {
|
||||
public static let liveValue = Self(
|
||||
run: {
|
||||
[
|
||||
EquipmentInfo.Migrate(),
|
||||
Project.Migrate(),
|
||||
Room.Migrate(),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user