updateApiKey method

Future<ApiHashModel> updateApiKey(
  1. ApiHashModel newModel
)

Implementation

Future<ApiHashModel> updateApiKey(ApiHashModel newModel) async {
  var selector = where.eq('apiHash', newModel.apiHash);
  var update = modify.set('active', newModel.active);
  await _collection.updateOne(selector, update);
  _apiKeysRepo.updateSavedKeys(newModel);
  return newModel;
}