Skip to content

Commit a0ca78a

Browse files
committed
Remove unnecessary changes
1 parent c8fde36 commit a0ca78a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Modules/Sources/Yosemite/Stores/CustomerStore.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,14 @@ public final class CustomerStore: Store {
117117
let hasNextPage = customers.count == pageSize
118118
if retrieveFullCustomersData {
119119
self.mapSearchResultsToCustomerObjects(for: siteID,
120-
with: keyword,
121-
with: customers,
122-
hasNextPage: hasNextPage,
123-
onCompletion: onCompletion)
120+
with: keyword,
121+
with: customers,
122+
onCompletion: { result in
123+
switch result {
124+
case .success: onCompletion(.success(hasNextPage))
125+
case .failure(let error): onCompletion(.failure(error))
126+
}
127+
})
124128
} else {
125129
self.upsertCustomersAndSave(siteID: siteID,
126130
readOnlyCustomers: customers,
@@ -262,14 +266,12 @@ public final class CustomerStore: Store {
262266
/// - siteID: The site for which customers should be fetched.
263267
/// - keyword: The keyword used for the Customer search query.
264268
/// - searchResults: A WCAnalyticsCustomer collection that represents the matches we've got from the API based in our keyword search.
265-
/// - hasNextPage: Whether there are more pages available.
266269
/// - onCompletion: Invoked when the operation finishes. Will map the result to a `[Customer]` entity.
267270
///
268271
private func mapSearchResultsToCustomerObjects(for siteID: Int64,
269272
with keyword: String,
270273
with searchResults: [WCAnalyticsCustomer],
271-
hasNextPage: Bool,
272-
onCompletion: @escaping (Result<Bool, Error>) -> Void) {
274+
onCompletion: @escaping (Result<Void, Error>) -> Void) {
273275
var customers = [Customer]()
274276
let group = DispatchGroup()
275277
for result in searchResults {
@@ -294,7 +296,7 @@ public final class CustomerStore: Store {
294296
keyword: keyword,
295297
readOnlyCustomers: customers,
296298
onCompletion: {
297-
onCompletion(.success(hasNextPage))
299+
onCompletion(.success(()))
298300
}
299301
)
300302
}

WooCommerce/Classes/Bookings/BookingFilters/CustomerListSyncable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct CustomerListSyncable: ListSyncable {
8484
func selectionEnabled(for item: Customer) -> Bool {
8585
item.customerID > 0
8686
}
87-
87+
8888
func filterItem(for item: Customer) -> BookingCustomerFilter {
8989
let name: String = {
9090
if let firstName = item.firstName, let lastName = item.lastName {

0 commit comments

Comments
 (0)