import axios from 'axios';

const travelService = {
    getTravelEntries: async (param) => {
        try {
            return await axios.get(`Travels/${param}/getEntries`);
        } catch (err) {
            console.error(`Error fetching travel entries`, err);
            return err.response;
        }
    },

    updateTravel: async (id, params) => {
        try {
            return await axios.patch(`Travels/${id}`, params);
        } catch (err) {
            console.error(`Error updating travel`, err);
            return err.response;
        }
    },
};

export default travelService;
