mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 18:22:16 +01:00
use prop function createTag instead of event to make sure it is handled by the parent
This commit is contained in:
@@ -17,7 +17,6 @@ import { storeToRefs } from 'pinia';
|
||||
import { useTasksStore } from '@/utils/useTasks';
|
||||
import { useProjectsStore } from '@/utils/useProjects';
|
||||
import { useTagsStore } from '@/utils/useTags';
|
||||
import type { Tag } from '@/utils/api';
|
||||
const projectStore = useProjectsStore();
|
||||
const { projects } = storeToRefs(projectStore);
|
||||
const taskStore = useTasksStore();
|
||||
@@ -75,11 +74,8 @@ async function submit() {
|
||||
show.value = false;
|
||||
}
|
||||
const { tags } = storeToRefs(useTagsStore());
|
||||
async function createTag(tag: string, callback: (tag: Tag) => void) {
|
||||
const newTag = await useTagsStore().createTag(tag);
|
||||
if (newTag !== undefined) {
|
||||
callback(newTag);
|
||||
}
|
||||
async function createTag(tag: string) {
|
||||
return await useTagsStore().createTag(tag);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -118,7 +114,7 @@ async function createTag(tag: string, callback: (tag: Tag) => void) {
|
||||
<div class="flex items-center space-x-2 px-4">
|
||||
<TimeTrackerTagDropdown
|
||||
:tags="tags"
|
||||
@createTag="createTag"
|
||||
:createTag="createTag"
|
||||
v-model="timeEntry.tags"></TimeTrackerTagDropdown>
|
||||
<BillableToggleButton
|
||||
v-model="timeEntry.billable"></BillableToggleButton>
|
||||
|
||||
Reference in New Issue
Block a user