Skip to content

Commit c2e7194

Browse files
committed
Add method for refreshing coupons in coupon list view model
1 parent 5c909ec commit c2e7194

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

WooCommerce/Classes/ViewRelated/Coupons/CouponManagementListViewModel.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ final class CouponListViewModel {
116116
func coupon(at indexPath: IndexPath) -> Coupon? {
117117
return resultsController.safeObject(at: indexPath)
118118
}
119+
120+
/// Triggers a refresh of loaded coupons
121+
///
122+
func refreshCoupons() {
123+
syncingCoordinator.resynchronize(reason: nil, onCompletion: nil)
124+
}
119125
}
120126

121127

0 commit comments

Comments
 (0)