claimOwnerShipApplication function

Future<AppModel> claimOwnerShipApplication(
  1. String appId,
  2. String ownerID
)

Implementation

Future<AppModel> claimOwnerShipApplication(String appId, String ownerID) async {
  // first delete the app
  AppModel? oldApp = await appRepository()!.get(appId);
  if (oldApp != null) {
    await appRepository()!.delete(oldApp);
  }

  // add the app
  var application = AppModel(
    documentID: appId,
    ownerID: ownerID,
  );
  return await AbstractMainRepositorySingleton.singleton
      .appRepository()!
      .add(application);
}