import 'package:tangheem/classes/consts.dart';
import 'package:tangheem/models/authentication_user_model.dart';

import 'api_client.dart';

class AuthenticationApiClient {
  static final AuthenticationApiClient _instance = AuthenticationApiClient._internal();

  AuthenticationApiClient._internal();

  factory AuthenticationApiClient() => _instance;

  Future<AuthenticationUserModel> authenticateUser(String email, String password) async {
    String url = "${ApiConsts.authentication}MobileLogin";
    var postParams = {"email": email, "password": password};
    return await ApiClient().postJsonForObject((json) => AuthenticationUserModel.fromJson(json), url, postParams);
  }
}
