loyaltyPointsRedeem method Null safety
override
It's used to apply points
Implementation
@override
Future<CheckouCartSummaryModel> loyaltyPointsRedeem(
{required int customerId,
required int addressId,
required int loyaltyPoints,
int? storeId}) async {
final response = await postData(
path: 'LoyaltyPoints/Redeem',
queryParameters: {
"CustomerID": customerId,
"LoyaltyPointsRedeemed": loyaltyPoints,
"ShipmentAddressID": addressId,
"PickStoreID": storeId,
},
);
final result = ApiReturnResult.fromJSON(response.data);
if (result.code == 200) {
return CheckouCartSummaryModel.fromJson(result.data);
} else {
throw ExceptionApi(code: result.code, message: result.error?.first);
}
}