refreshRelations static method

Future<DocumentItemModel> refreshRelations(
  1. DocumentItemModel model
)

Implementation

static Future<DocumentItemModel> refreshRelations(
    DocumentItemModel model) async {
  PlatformMediumModel? imageHolder;
  if (model.image != null) {
    try {
      await platformMediumRepository()!
          .get(model.image!.documentID)
          .then((val) {
        imageHolder = val;
      }).catchError((error) {});
    } catch (_) {}
  }

  return model.copyWith(
    image: imageHolder,
  );
}