fix: Fixes duct sizing rooms table not showing forms correctly, updates the table styles.

This commit is contained in:
2026-01-14 10:32:57 -05:00
parent 71848c607a
commit 450791b37e
8 changed files with 158 additions and 143 deletions

View File

@@ -14,6 +14,8 @@ extension DatabaseClient {
public var get: @Sendable (Room.ID) async throws -> Room?
public var fetch: @Sendable (Project.ID) async throws -> [Room]
public var update: @Sendable (Room.ID, Room.Update) async throws -> Room
public var updateRectangularSize:
@Sendable (Room.ID, DuctSizing.RectangularDuct) async throws -> Room
}
}
@@ -67,6 +69,19 @@ extension DatabaseClient.Rooms: TestDependencyKey {
try await model.save(on: database)
}
return try model.toDTO()
},
updateRectangularSize: { id, size in
guard let model = try await RoomModel.find(id, on: database) else {
throw NotFoundError()
}
var rectangularSizes = model.rectangularSizes ?? []
rectangularSizes.removeAll {
$0.id == size.id
}
rectangularSizes.append(size)
model.rectangularSizes = rectangularSizes
try await model.save(on: database)
return try model.toDTO()
}
)
}