import api from './api';

const portalGuideService = {
    getAll: async () => {
        const res = await api.get('/portal-guides');
        return res.data;
    },
    getById: async (id) => {
        const res = await api.get(`/portal-guides/${id}`);
        return res.data;
    },
    getHtmlUrl: (id) => `/api/portal-guides/${id}/html`,
    create: async (data) => {
        const res = await api.post('/portal-guides', data);
        return res.data;
    },
    update: async (id, data) => {
        const res = await api.put(`/portal-guides/${id}`, data);
        return res.data;
    },
    delete: async (id) => {
        await api.delete(`/portal-guides/${id}`);
    },
};

export default portalGuideService;
