deactivatePromotionByCode method

Future<void> deactivatePromotionByCode(
  1. String code, {
  2. required void onSuccess(),
  3. required void onError(
    1. SyneriseError error
    ),
})

This function deactivates a promotion by its code.

Args: code (String): The "code" parameter is a string that represents the code of the promotion that needs to be deactivated.

Implementation

Future<void> deactivatePromotionByCode(String code,
    {required void Function() onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<void> result =
      await _methods.deactivatePromotionByCode(code);

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