cleanup and fix formatting for utils and packages

This commit is contained in:
Gregor Vostrak
2024-08-22 15:43:04 +02:00
parent 1328692faf
commit 249b1b5820
6 changed files with 26 additions and 65 deletions

View File

@@ -40,30 +40,38 @@ const props = defineProps<{
}>();
function updateTimeEntryDescription(description: string) {
const updatedTimeEntries = props.timeEntry.timeEntries.map((entry: TimeEntry) => {
return { ...entry, description };
});
const updatedTimeEntries = props.timeEntry.timeEntries.map(
(entry: TimeEntry) => {
return { ...entry, description };
}
);
props.updateTimeEntries(updatedTimeEntries);
}
function updateTimeEntryTags(tags: string[]) {
const updatedTimeEntries = props.timeEntry.timeEntries.map((entry: TimeEntry) => {
return { ...entry, tags };
});
const updatedTimeEntries = props.timeEntry.timeEntries.map(
(entry: TimeEntry) => {
return { ...entry, tags };
}
);
props.updateTimeEntries(updatedTimeEntries);
}
function updateTimeEntryBillable(billable: boolean) {
const updatedTimeEntries = props.timeEntry.timeEntries.map((entry: TimeEntry) => {
return { ...entry, billable };
});
const updatedTimeEntries = props.timeEntry.timeEntries.map(
(entry: TimeEntry) => {
return { ...entry, billable };
}
);
props.updateTimeEntries(updatedTimeEntries);
}
function updateProjectAndTask(projectId: string, taskId: string) {
const updatedTimeEntries = props.timeEntry.timeEntries.map((entry: TimeEntry) => {
return { ...entry, project_id: projectId, task_id: taskId };
});
const updatedTimeEntries = props.timeEntry.timeEntries.map(
(entry: TimeEntry) => {
return { ...entry, project_id: projectId, task_id: taskId };
}
);
props.updateTimeEntries(updatedTimeEntries);
}