refreshRelations static method

Future<CartItemModel> refreshRelations(
  1. CartItemModel model
)

Implementation

static Future<CartItemModel> refreshRelations(CartItemModel model) async {
  ProductModel? productHolder;
  if (model.product != null) {
    try {
      await productRepository()!.get(model.product!.documentID).then((val) {
        productHolder = val;
      }).catchError((error) {});
    } catch (_) {}
  }

  return model.copyWith(
    product: productHolder,
  );
}