automatically select project after create in time tracker component, fixes ST-457

This commit is contained in:
Gregor Vostrak
2024-10-16 18:10:07 +02:00
committed by Constantin Graf
parent d080b07e60
commit 5593d141ea

View File

@@ -84,7 +84,11 @@ const isRunningInDifferentOrganization = computed(() => {
async function createProject(
project: CreateProjectBody
): Promise<Project | undefined> {
return await useProjectsStore().createProject(project);
const newProject = await useProjectsStore().createProject(project);
if (newProject) {
currentTimeEntry.value.project_id = newProject.id;
}
return newProject;
}
async function createClient(client: CreateClientBody) {
return await useClientsStore().createClient(client);