normalizeNotes function

Map<String, dynamic> normalizeNotes(
  1. Map<String, dynamic>? notes
)

Normalizes notes map for older API versions (maybe not needed with JSON serialization). Kept for parity if specific API endpoints require this format.

Implementation

Map<String, dynamic> normalizeNotes(Map<String, dynamic>? notes) {
  if (notes == null) {
    return {};
  }
  final normalized = <String, dynamic>{};
  notes.forEach((key, value) {
    normalized['notes[$key]'] = value;
  });
  return normalized;
}