mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-23 05:19:42 +01:00
Remove needless fetchArray
This commit is contained in:
parent
e91a8b4b0a
commit
4742e3112b
@ -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 New Issue
Block a user