Client/lib/api/marianumcloud/talk/getParticipants/getParticipantsCache.dart

26 lines
669 B
Dart

import 'dart:convert';
import '../../../requestCache.dart';
import 'getParticipants.dart';
import 'getParticipantsResponse.dart';
class GetParticipantsCache extends RequestCache<GetParticipantsResponse> {
String chatToken;
GetParticipantsCache({required onUpdate, required this.chatToken}) : super(RequestCache.cacheNothing, onUpdate) {
start("MarianumMobile", "nc-chat-participants-$chatToken");
}
@override
Future<GetParticipantsResponse> onLoad() {
return GetParticipants(
chatToken,
).run();
}
@override
GetParticipantsResponse onLocalData(String json) {
return GetParticipantsResponse.fromJson(jsonDecode(json));
}
}