import axios from 'axios';
export const ScenarioService = {
    
    getScenarios() {
        return axios.get('/scenarios')

    },
    getScenariosProject(projectId) {
        return axios.post('/scenariosProject' , projectId)

    },
    getScenariosApplication(app) {
        return axios.post('/scenariosByApp' , app)

    },
    getScenariosCross() {
        return axios.get('/scenariosCross')

    },

    getExecScenariosByUser(page = 0, size = 10, filters = {}, sortField, sortOrder) {
        // Filtri potrebbero essere vuoti, quindi rimuoviamoli se non necessari
        const requestBody = { page, size, ...filters, sortField, sortOrder }; 
        return axios.post('/executions', requestBody);
    }
    
    ,
    getScenariosForRE(){
        return axios.get('/getScenariosForRE')
    },
    updateScenarioExecRating(id, rating) {   
        return axios.get('/updateRating?id=' + id + '&rating=' + rating)
    },

    getExecScenarioByProject () {
        return axios.get('/getExecScenarioByProject')
    }

}