customMany method
Implementation
@override
Future<List<Map<String, Object?>>> customMany({
required String operation,
required CustomBody body,
String? authorization,
}) async {
final response = await _client.request(
method: 'PATCH',
path: '/db/custom/${operation}/many',
headers: {'authorization': authorization},
body: body,
);
final _body = await response.transform(utf8.decoder).join();
if (jsonDecode(_body) case {'data': final List data}) {
return data
.map(
(e) => (e as Map).map(
(key, value) => MapEntry((key as String), value),
),
)
.toList();
}
throw Exception('Invalid response');
}