import { api } from "src/boot/axios";
import type { Shift, ShiftAPIResponse } from "src/modules/timesheets/models/shift.models";

export const ShiftService = {
    deleteShiftById: async (shift_id: number) => {
        const response = await api.delete(`/shift/${shift_id}`);
        return response.data;
    },

    createNewShifts: async (new_shifts: Shift[]):Promise<ShiftAPIResponse[]> => {
        const response = await api.post(`/shift/create`, new_shifts);
        return response.data;
    },

    updateShifts: async (existing_shifts: Shift[]) => {
        console.log('sent shifts: ', existing_shifts)
        const response = await api.patch(`/shift/update`, existing_shifts);
        return response;
    }
};