fix(timesheet): remove explicit undefined where unnecessary
This commit is contained in:
parent
6c10cbb7fa
commit
b8ce517a02
|
|
@ -7,7 +7,7 @@ export const useShiftApi = () => {
|
||||||
const shift_store = useShiftStore();
|
const shift_store = useShiftStore();
|
||||||
const auth_store = useAuthStore();
|
const auth_store = useAuthStore();
|
||||||
|
|
||||||
const deleteShiftById = async (shift_id: number, employee_email?: string | undefined) => {
|
const deleteShiftById = async (shift_id: number, employee_email?: string) => {
|
||||||
timesheet_store.is_loading = true;
|
timesheet_store.is_loading = true;
|
||||||
const success = await shift_store.deleteShiftById(shift_id, employee_email);
|
const success = await shift_store.deleteShiftById(shift_id, employee_email);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { BackendResponse } from "src/modules/shared/models/backend-response
|
||||||
import type { Shift } from "src/modules/timesheets/models/shift.models";
|
import type { Shift } from "src/modules/timesheets/models/shift.models";
|
||||||
|
|
||||||
export const ShiftService = {
|
export const ShiftService = {
|
||||||
deleteShiftById: async (shift_id: number, employee_email?: string | undefined) => {
|
deleteShiftById: async (shift_id: number, employee_email?: string) => {
|
||||||
if (employee_email) {
|
if (employee_email) {
|
||||||
const response = await api.delete(`/shift/${shift_id}/${employee_email}`);
|
const response = await api.delete(`/shift/${shift_id}/${employee_email}`);
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|
@ -13,7 +13,7 @@ export const ShiftService = {
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
createNewShifts: async (new_shifts: Shift[], employee_email?: string | undefined):Promise<BackendResponse<Shift>> => {
|
createNewShifts: async (new_shifts: Shift[], employee_email?: string):Promise<BackendResponse<Shift>> => {
|
||||||
if (employee_email) {
|
if (employee_email) {
|
||||||
const response = await api.post(`/shift/create/${employee_email}`);
|
const response = await api.post(`/shift/create/${employee_email}`);
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|
@ -23,7 +23,7 @@ export const ShiftService = {
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateShifts: async (existing_shifts: Shift[], employee_email?: string | undefined):Promise<BackendResponse<Shift>> => {
|
updateShifts: async (existing_shifts: Shift[], employee_email?: string):Promise<BackendResponse<Shift>> => {
|
||||||
if (employee_email) {
|
if (employee_email) {
|
||||||
const response = await api.patch(`/shift/update/${employee_email}`);
|
const response = await api.patch(`/shift/update/${employee_email}`);
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user