import axios from 'axios';

export const ScenarioExecutionService = {
    getExecScenariosByUser(page = 0, size = 10, filters = {}, sortField, sortOrder) {
        const requestBody = { page, size, ...filters, sortField, sortOrder };
        return axios.post('/executions', requestBody);
    },

    downloadFile(filePath, executionId) {
        return axios.get('/downloadFile', {
            params: {
                filePath: filePath,
                executionId: executionId
            },
            responseType: 'blob' // Importante per gestire il download di file
        });
    }
};
