save method

Save.

Implementation

NmCommandValidationResult save(NmTelecomL10n l10n) {
  final value = draft?.working;
  if (value == null) return const NmCommandValidationResult([]);
  final result = validateCommandSet(value, l10n, otherIds: repository.records.where((item) => item.id != value.id).map((item) => item.id));
  if (!result.isValid) return result;
  repository.replace(value.id, value);
  draft = null;
  notifyListeners();
  return result;
}