Skip to content

Commit dc606cb

Browse files
committed
Delete the loadCustomer action since we don't use it anymore
1 parent a7aa35e commit dc606cb

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

Modules/Sources/Yosemite/Actions/CustomerAction.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,4 @@ public enum CustomerAction: Action {
100100
///- `siteID`: The site for which customers should be delete.
101101
///- `onCompletion`: Invoked when the operation finishes.
102102
case deleteAllCustomers(siteID: Int64, onCompletion: () -> Void)
103-
104-
/// Loads a customer for the specified `siteID` and `customerID` from storage.
105-
case loadCustomer(siteID: Int64, customerID: Int64, onCompletion: (Result<Customer, Error>) -> Void)
106103
}

Modules/Sources/Yosemite/Stores/CustomerStore.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ public final class CustomerStore: Store {
8080
synchronizeAllCustomers(siteID: siteID, pageNumber: pageNumber, pageSize: pageSize, onCompletion: onCompletion)
8181
case .deleteAllCustomers(siteID: let siteID, onCompletion: let onCompletion):
8282
deleteAllCustomers(from: siteID, onCompletion: onCompletion)
83-
case let .loadCustomer(siteID, customerID, onCompletion):
84-
loadCustomer(siteID: siteID, customerID: customerID, onCompletion: onCompletion)
8583
}
8684
}
8785

@@ -253,16 +251,6 @@ public final class CustomerStore: Store {
253251
}, completion: onCompletion, on: .main)
254252
}
255253

256-
private func loadCustomer(siteID: Int64, customerID: Int64, onCompletion: @escaping (Result<Networking.Customer, Error>) -> Void) {
257-
let customers = storageManager.viewStorage.loadCustomers(siteID: siteID, matching: [customerID])
258-
if let storageCustomer = customers.first {
259-
let customer = storageCustomer.toReadOnly()
260-
onCompletion(.success(customer))
261-
} else {
262-
onCompletion(.failure(CustomerStoreError.notFound))
263-
}
264-
}
265-
266254
/// Maps CustomerSearchResult to Customer objects
267255
///
268256
/// - Parameters:

0 commit comments

Comments
 (0)