import 'package:cheminova/models/user_model.dart';
import 'package:cheminova/utils/common_api_service.dart';
import 'package:cheminova/utils/show_snackbar.dart';

class HomeService {
  Future<UserModel?> getUser() async {
    try {
      final response = await commonApiService<UserModel>(
        method: "GET",
        url: "/api/territorymanager/my-profile",
        fromJson: (json) => UserModel.fromJson(json),
      );

      return response;
    } catch (e) {
      showSnackbar(e.toString());
    }
    return null;
  }
}
