import 'package:boilerplate/data/data_source/remote/api_provider.dart';
import 'package:boilerplate/data/repositories/base_repository.dart';
import 'package:injectable/injectable.dart';

@injectable
class AuthRepository extends BaseRepository {
  final ApiProvider _api;

  AuthRepository(this._api);

  Future<String> login(Map<String, dynamic> data) async {
    final res = await _api.post('/api/auth/login', body: data)
      ..responseHandler();

    return res.data['result']['token'];
  }
}
