31 lines
790 B
Dart
31 lines
790 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:http/http.dart' as http;
|
|
import 'package:http/http.dart';
|
|
|
|
import '../../../api_params.dart';
|
|
import '../talk_api.dart';
|
|
import 'get_reactions_response.dart';
|
|
|
|
class GetReactions extends TalkApi<GetReactionsResponse> {
|
|
String chatToken;
|
|
int messageId;
|
|
GetReactions({required this.chatToken, required this.messageId})
|
|
: super('v1/reaction/$chatToken/$messageId', null);
|
|
|
|
@override
|
|
GetReactionsResponse assemble(String raw) {
|
|
final decoded = jsonDecode(raw) as Map<String, dynamic>;
|
|
return GetReactionsResponse.fromJson(
|
|
decoded['ocs'] as Map<String, dynamic>,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Future<Response>? request(
|
|
Uri uri,
|
|
ApiParams? body,
|
|
Map<String, String>? headers,
|
|
) => http.get(uri, headers: headers);
|
|
}
|