mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-22 15:16:36 +00:00
Remove needless fetchArray
This commit is contained in:
parent
e91a8b4b0a
commit
4742e3112b
2 changed files with 1 additions and 6 deletions
|
@ -31,9 +31,4 @@ public class Client: ObservableObject {
|
|||
let (data, _) = try await urlSession.data(from: makeURL(endpoint: endpoint))
|
||||
return try decoder.decode(Entity.self, from: data)
|
||||
}
|
||||
|
||||
public func fetchArray<Entity: Codable>(endpoint: Endpoint) async throws -> [Entity] {
|
||||
let (data, _) = try await urlSession.data(from: makeURL(endpoint: endpoint))
|
||||
return try decoder.decode([Entity].self, from: data)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class TimelineViewModel: ObservableObject {
|
|||
|
||||
func refreshTimeline() async {
|
||||
do {
|
||||
statuses = try await client.fetchArray(endpoint: Timeline.pub(sinceId: nil))
|
||||
statuses = try await client.fetch(endpoint: Timeline.pub(sinceId: nil))
|
||||
state = .display(statuses: statuses, nextPageState: .hasNextPage)
|
||||
} catch {
|
||||
state = .error(error: error)
|
||||
|
|
Loading…
Reference in a new issue