Implement changes from TaskService.
This commit is contained in:
parent
5bc27f6061
commit
9c219054d3
@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import type { PageProps } from "./$types";
|
||||
import type { PageProps } from "./$types";
|
||||
|
||||
let { data }: PageProps = $props();
|
||||
let { data }: PageProps = $props();
|
||||
</script>
|
||||
|
||||
{#if data.tasks.status === "ok" && data.tasks.tasks !== undefined}
|
||||
<p>{data.tasks.tasks.length} total records.</p>
|
||||
{#if data.tasks.status === "ok" && data.tasks.data !== undefined}
|
||||
<p>{data.tasks.data.length} total records.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -15,14 +15,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each data.tasks.tasks as task (task.id)}
|
||||
{#each data.tasks.data as task (task.id)}
|
||||
<tr>
|
||||
<td>
|
||||
<a
|
||||
href={`/tasks/${task.type.prefix}${task.taskId}`}
|
||||
>
|
||||
{task.type?.prefix +
|
||||
task.taskId}
|
||||
<a href={`/tasks/${task.type.prefix}${task.taskId}`}>
|
||||
{
|
||||
task.type?.prefix
|
||||
+ task.taskId
|
||||
}
|
||||
</a>
|
||||
</td>
|
||||
<td>{task.description}</td>
|
||||
|
||||
@ -1,23 +1,37 @@
|
||||
<script lang="ts">
|
||||
import type { PageProps } from "./$types";
|
||||
import type { PageProps } from "./$types";
|
||||
|
||||
let { data }: PageProps = $props();
|
||||
const task = data.task.tasks[0];
|
||||
let { data }: PageProps = $props();
|
||||
</script>
|
||||
|
||||
<h1>{`[[${task.type.prefix}${task.taskId}]] - ${task.description}`}</h1>
|
||||
<div class="container">
|
||||
{#if data.task.status === "ok"}
|
||||
{@const task = data.task.data[0]}
|
||||
{#if task}
|
||||
<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>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Body</h2>
|
||||
<p>{task.body}</p>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<p>Task not found.</p>
|
||||
{/if}
|
||||
{:else if data.task.status === "failure"}
|
||||
<h2>Error Loading Task</h2>
|
||||
<p>{data.task.error}</p>
|
||||
{#if data.task.code}
|
||||
<p>Error code: {data.task.code}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.container {
|
||||
.container {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user