package com.example.quiz.viewModel;

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

import com.example.quiz.data.model.Course;
import com.example.quiz.data.model.PagedModel;
import com.example.quiz.data.repository.CourseRepository;
import com.example.quiz.utils.Result;

import java.util.List;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;

@HiltViewModel
public class CourseViewModel extends ViewModel {
    private final CourseRepository courseRepository;

    private LiveData<Result<PagedModel<Course>>> courses;

    @Inject
    public CourseViewModel(CourseRepository courseRepository){
        this.courseRepository = courseRepository;
    }

    public LiveData<Result<PagedModel<Course>>> getCourses(String reunionDate){
        courses = courseRepository.getCourses(reunionDate);
        return courses;
    }
}
