Skip to content

Commit

Permalink
fix: geocoding modifiable context on invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
DadiBit committed Jun 11, 2023
1 parent 049ec54 commit f2f7e79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/src/main/kotlin/com/openmeteo/api/GeocodingGet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ object GeocodingGet : Endpoint(
URL("https://geocoding-api.open-meteo.com/v1/get")
) {

operator fun invoke(query: Query) = query<Response, Query>(query)
operator fun invoke(query: Query, context: URL = this.context) =
query<Response, Query>(query, context)

@Serializable
open class Query(
Expand Down
3 changes: 2 additions & 1 deletion lib/src/main/kotlin/com/openmeteo/api/GeocodingSearch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ object GeocodingSearch : Endpoint(
URL("https://geocoding-api.open-meteo.com/v1/search")
) {

operator fun invoke(query: Query) = query<Response, Query>(query)
operator fun invoke(query: Query, context: URL = this.context) =
query<Response, Query>(query, context)

@Serializable
open class Query(
Expand Down

0 comments on commit f2f7e79

Please sign in to comment.