Add route to view a single task.

This commit is contained in:
themodrnhakr 2025-09-29 00:32:24 -05:00
parent 8c0970a19a
commit e41f651e00
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,9 @@
import TasksService from "$lib/server/services/tasks";
import type { PageServerData } from "./$types";
export const load: PageServerData = async ({ params }) => {
const tasks = new TasksService("internal");
return {
task: await tasks.getByTaskId([params.task_id]),
};
};

View File

@ -0,0 +1,23 @@
<script lang="ts">
import type { PageProps } from "./$types";
let { data }: PageProps = $props();
const task = data.task.tasks[0];
</script>
<h1>{`[[${task.type.prefix}${task.taskId}]] - ${task.description}`}</h1>
<div class="container">
<p><strong>{task.status}</strong></p>
<p><strong>{task.priority}</strong></p>
</div>
<div>
<h2>Body</h2>
<p>{task.body}</p>
</div>
<style>
.container {
display: flex;
gap: 1rem;
}
</style>