adjustments

This commit is contained in:
Emily
2024-06-03 02:14:57 +02:00
parent 2ff3cd134f
commit 65ecbaa550
7 changed files with 55 additions and 147 deletions

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
definePageMeta({ layout: 'dashboard' });
const projectName = ref<string>("");
@@ -8,7 +7,7 @@ const creating = ref<boolean>(false);
const router = useRouter();
const { data: projects, refresh: refreshProjects } = useProjectsList();
const { projects, refresh } = useProjectsList();
const isFirstProject = computed(() => { return projects.value?.length == 0; })
@@ -37,7 +36,7 @@ async function createProject() {
body: JSON.stringify({ name: projectName.value })
});
await refreshProjects();
await refresh();
const newActiveProjectId = projects.value?.[projects.value?.length - 1]._id.toString();
if (newActiveProjectId) {
@@ -45,9 +44,6 @@ async function createProject() {
}
await refreshProjects();
router.push('/');
} catch (ex: any) {