Skip to content

Commit 9fd2816

Browse files
committed
Add comments
1 parent c8dbd27 commit 9fd2816

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

WooCommerce/Classes/ViewRelated/Products/ProductsListViewModel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class ProductListViewModel {
4343
selectedProducts.removeAll()
4444
}
4545

46+
/// Check if selected products share the same common ProductStatus. Returns `nil` otherwise.
47+
///
4648
var commonStatusForSelectedProducts: ProductStatus? {
4749
let status = selectedProducts.first?.productStatus
4850
if selectedProducts.allSatisfy({ $0.productStatus == status }) {
@@ -52,6 +54,8 @@ class ProductListViewModel {
5254
}
5355
}
5456

57+
/// Update selected products with new ProductStatus and trigger Network action to save the change remotely.
58+
///
5559
func updateSelectedProducts(with newStatus: ProductStatus, completion: @escaping (Result<Void, Error>) -> Void ) {
5660
guard selectedProductsCount > 0 else {
5761
completion(.failure(BulkEditError.noProductsSelected))

0 commit comments

Comments
 (0)