mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Handle empty poll list case
This commit is contained in:
@@ -15,13 +15,15 @@
|
||||
//
|
||||
|
||||
final class MockPollHistoryService: PollHistoryServiceProtocol {
|
||||
var pollListData: [PollListData] = (1..<10)
|
||||
.map { index in
|
||||
PollListData(startDate: .init().addingTimeInterval(-CGFloat(index) * 3600), question: "Do you like the poll number \(index)?")
|
||||
}
|
||||
.sorted { poll1, poll2 in
|
||||
poll1.startDate > poll2.startDate
|
||||
}
|
||||
|
||||
func fetchHistory() async throws -> [PollListData] {
|
||||
(1..<10)
|
||||
.map { index in
|
||||
PollListData(startDate: .init().addingTimeInterval(-CGFloat(index) * 3600), question: "Do you like the poll number \(index)?")
|
||||
}
|
||||
.sorted { poll1, poll2 in
|
||||
poll1.startDate > poll2.startDate
|
||||
}
|
||||
pollListData
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user