PokemonAPI icon indicating copy to clipboard operation
PokemonAPI copied to clipboard

[API] Incorrect API enum used for fetching version

Open lmcjt37 opened this issue 10 months ago • 0 comments

Currently in version 6.1.1, it is pointing to the incorrect API enum, and therefore incorrect endpoint, when we call fetchVersion which is currently using 'Generation'. See below for the incorrect calls.

This is only in the 'Async Services' of the package, the other areas are correctly using the right endpoint

Currently

// MARK: - Async Services

extension GameService {
...
@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
public func fetchVersion(_ versionID: Int) async throws -> PKMVersion {
    try await PKMVersion.decode(from: call(endpoint: API.fetchGenerationByID(versionID)))
}

@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
public func fetchVersion(_ versionName: String) async throws -> PKMVersion {
    try await PKMVersion.decode(from: call(endpoint: API.fetchGenerationByName(versionName)))
}

lmcjt37 avatar Apr 07 '24 21:04 lmcjt37