import 'package:fis_jsonrpc/rpc.dart';
import 'package:vnoteapp/rpc.dart';
import 'package:vnoteapp/store/store.dart';
import 'package:fis_common/logger/logger.dart';

import 'interfaces/doctor.dart';

class DoctorManager implements IDoctorManager {
  @override
  Future<void> syncInfo() async {
    try {
      final userInfo = await rpc.user.getUserDetailAsync(
        GetUserRequest(token: Store.user.token),
      );
      Store.user.updateUserInfo(userInfo);
    } catch (e) {
      logger.e("DoctorManager sync user info error.", e);
    }
  }
}
