import { SendRequest } from '../components/Global/ApiRequest';

const getAllJadwalShift = async (queryParams) => {
    const response = await SendRequest({
        method: 'get',
        prefix: `jadwal-shift?${queryParams.toString()}`,
    });

    return response.data;
};

const getJadwalShiftById = async (id) => {
    const response = await SendRequest({
        method: 'get',
        prefix: `jadwal-shift/${id}`,
    });

    return response.data;
};

const createJadwalShift = async (queryParams) => {
    const response = await SendRequest({
        method: 'post',
        prefix: `jadwal-shift`,
        params: queryParams,
    });

    return response.data;
};

const updateJadwalShift = async (id, queryParams) => {
    const response = await SendRequest({
        method: 'put',
        prefix: `jadwal-shift/${id}`,
        params: queryParams,
    });

    return response.data;
};

const deleteJadwalShift = async (id) => {
    const response = await SendRequest({
        method: 'delete',
        prefix: `jadwal-shift/${id}`,
    });
    return response.data;
};

export {
    getAllJadwalShift,
    getJadwalShiftById,
    createJadwalShift,
    updateJadwalShift,
    deleteJadwalShift,
};
