work-hub-server/apps/web/app/pages/projects/new.vue

35 lines
689 B
Vue

<script setup lang="ts">
definePageMeta({
title: "New Project",
});
const router = useRouter();
const { createProject } = useProjectApi();
const saving = ref(false);
async function handleSubmit(body: { name: string; description?: string; status: string }) {
saving.value = true;
const project = await createProject(body);
saving.value = false;
if (project) router.push("/projects");
}
</script>
<template>
<UPage>
<UPageHeader
title="New Project"
description="Create a new project"
/>
<UPageBody>
<UCard>
<ProjectForm
:saving
@submit="handleSubmit"
/>
</UCard>
</UPageBody>
</UPage>
</template>