Skip to content

Commit

Permalink
refactor: General improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Jan 30, 2025
1 parent ad6b17a commit 0e4489a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/InfomaniakCore/Networking/ApiFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import InfomaniakDI
import InfomaniakLogin
import Sentry

public typealias EncodableParameters = [String: any Encodable & Sendable]
public typealias EncodableParameters = [String: Encodable & Sendable]

public protocol RefreshTokenDelegate: AnyObject {
func didUpdateToken(newToken: ApiToken, oldToken: ApiToken)
Expand Down Expand Up @@ -184,10 +184,10 @@ open class ApiFetcher {
overrideDecoder: JSONDecoder? = nil) async throws -> ValidServerResponse<T> {
let validatedRequest = request.validate(statusCode: ApiFetcher.handledHttpStatus)

let decoder = overrideDecoder ?? decoder
let requestDecoder = overrideDecoder ?? decoder
let dataResponse = await validatedRequest.serializingDecodable(ApiResponse<T>.self,
automaticallyCancelling: true,
decoder: decoder).response
decoder: requestDecoder).response

SentryDebug.httpResponseBreadcrumb(urlRequest: request.convertible.urlRequest, urlResponse: dataResponse.response)

Expand Down

0 comments on commit 0e4489a

Please sign in to comment.