-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into issue/14419-jetpack-setup-account-creation-1
# Conflicts: # Experiments/Experiments/DefaultFeatureFlagService.swift # Experiments/Experiments/FeatureFlag.swift
- Loading branch information
Showing
119 changed files
with
2,090 additions
and
1,535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
Networking/Networking/Mapper/WooPaymentsDepositsOverviewMapper.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import Foundation | ||
|
||
struct WooPaymentsDepositsOverviewMapper: Mapper { | ||
func map(response: Data) throws -> WooPaymentsDepositsOverview { | ||
struct WooPaymentsPayoutsOverviewMapper: Mapper { | ||
func map(response: Data) throws -> WooPaymentsPayoutsOverview { | ||
let decoder = JSONDecoder() | ||
decoder.dateDecodingStrategy = .millisecondsSince1970 | ||
|
||
if hasDataEnvelope(in: response) { | ||
return try decoder.decode(WooPaymentsDepositsOverviewEnvelope.self, from: response).depositsOverview | ||
return try decoder.decode(WooPaymentsPayoutsOverviewEnvelope.self, from: response).payoutsOverview | ||
} else { | ||
return try decoder.decode(WooPaymentsDepositsOverview.self, from: response) | ||
return try decoder.decode(WooPaymentsPayoutsOverview.self, from: response) | ||
} | ||
} | ||
} | ||
|
||
private struct WooPaymentsDepositsOverviewEnvelope: Decodable { | ||
let depositsOverview: WooPaymentsDepositsOverview | ||
private struct WooPaymentsPayoutsOverviewEnvelope: Decodable { | ||
let payoutsOverview: WooPaymentsPayoutsOverview | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case depositsOverview = "data" | ||
case payoutsOverview = "data" | ||
} | ||
} |
Oops, something went wrong.