import 'package:betting/commom/constants/api_constant.dart';
import 'package:betting/data/base_service/api_response.dart';
import 'package:betting/data/base_service/respone_data.dart';
import 'package:betting/data/model/base_model.dart';
import 'package:betting/data/model/res/profile/profile.dart';
import '../../base_service/api_service.dart';


class UserRepo {
  Future<ResponseData<BaseModel>> deleteUser(deviceId) async {
    ResponseData<BaseModel> streamEvent = ResponseData(state: Status.LOADING);

    var param = <String, dynamic>{};
    String urlApi = "${ApiConstants.API_USERS}$deviceId";
    ApiResponse<BaseModel> apiResponse =
    await ApiService(urlApi, request: param)
        .request(Request.DELETE);

    if (apiResponse.status == Status.SUCCESS) {
      streamEvent = ResponseData(state: Status.SUCCESS, object:  apiResponse.data);
    }

    if (apiResponse.status == Status.ERROR) {
      streamEvent = ResponseData(
          state: Status.ERROR,
          errorCode: apiResponse.error,
          message: apiResponse.error?.message);
    }
    return streamEvent;
  }


}