feat: Adds createMany for rooms, in prep for parsing / uploading a csv file of room loads.
All checks were successful
CI / Linux Tests (push) Successful in 7m0s
All checks were successful
CI / Linux Tests (push) Successful in 7m0s
This commit is contained in:
@@ -15,6 +15,13 @@ extension DatabaseClient.Rooms: TestDependencyKey {
|
||||
try await model.validateAndSave(on: database)
|
||||
return try model.toDTO()
|
||||
},
|
||||
createMany: { rooms in
|
||||
try await rooms.asyncMap { request in
|
||||
let model = try request.toModel()
|
||||
try await model.validateAndSave(on: database)
|
||||
return try model.toDTO()
|
||||
}
|
||||
},
|
||||
delete: { id in
|
||||
guard let model = try await RoomModel.find(id, on: database) else {
|
||||
throw NotFoundError()
|
||||
|
||||
Reference in New Issue
Block a user