activatePromotionsBatch method

Future<void> activatePromotionsBatch(
  1. List<PromotionIdentifier> promotionsToActivate, {
  2. required void onSuccess(),
  3. required void onError(
    1. SyneriseError error
    ),
})

This method activates promotions with a code or with UUID in a batch.

Args: promotionsToActivate (List

Implementation

Future<void> activatePromotionsBatch(
    List<PromotionIdentifier> promotionsToActivate,
    {required void Function() onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<void> result =
      await _methods.activatePromotionsBatch(promotionsToActivate);

  result.onSuccess((result) {
    onSuccess();
  }).onError((error) {
    onError(error);
  });
}