package com.example.timert.data.repository

import androidx.lifecycle.LiveData
import com.example.timert.data.dao.ExerciseDao
import com.example.timert.data.entity.Exercise

class ExerciseRepository(private val exerciseDao:ExerciseDao){
    val allExercise: LiveData<List<Exercise>> = exerciseDao.getExercise()
    suspend fun insert(training: Exercise) {
        exerciseDao.insert(training)
    }

    suspend fun deleteExerciseById(id: Int) {
        exerciseDao.deleteById(id)
    }

    fun getExercisesByTrainingId(trainingId: Int): LiveData<List<Exercise>> {
        return exerciseDao.getExercisesByTrainingId(trainingId)
    }

}