package com.example.quiz.viewModel;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.quiz.data.model.RaceReport;
import com.example.quiz.data.repository.RapportCourseRepository;
import com.example.quiz.utils.Result;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;

@HiltViewModel
public class RapportCourseViewModel extends ViewModel {
    private final RapportCourseRepository rapportCourseRepository;
    private LiveData<Result<RaceReport>> raceReport = new MutableLiveData<Result<RaceReport>>();
    @Inject
    public RapportCourseViewModel(RapportCourseRepository rapportCourseRepository) {
        this.rapportCourseRepository = rapportCourseRepository;
    }

    public LiveData<Result<RaceReport>> getRaceReport(String courseId) {
        raceReport = rapportCourseRepository.getRaceReport(courseId);
        return raceReport;
    }
}
