Skip to content

Commit 4757303

Browse files
committed
ui: show there are no matches if there are no matches
1 parent 8aa40b6 commit 4757303

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

web/src/routes/[projectId]/result/+page.svelte

+13-8
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,23 @@
2424
message: {res.message}
2525
{:else}
2626
{@const result = res.data}
27+
{@const matches = Object.entries(result.participantsOnEachRole)}
2728
<div class="hm-block">
2829
<h2 class="text-xl">{result.projectName}</h2>
2930
<p>{result.projectDesc}</p>
3031
</div>
31-
{#each Object.entries(result.participantsOnEachRole) as [_roleId, role]}
32-
<div class="hm-block">
33-
<h2 class="text-xl">{role.role_name}</h2>
34-
{#each role.participants as participant}
35-
<p>{participant.participant_name} さん</p>
36-
{/each}
37-
</div>
38-
{/each}
32+
{#if matches.length}
33+
{#each matches as [_roleId, role]}
34+
<div class="hm-block">
35+
<h2 class="text-xl">{role.role_name}</h2>
36+
{#each role.participants as participant}
37+
<p>{participant.participant_name} さん</p>
38+
{/each}
39+
</div>
40+
{/each}
41+
{:else}
42+
役職のある人はいません。
43+
{/if}
3944
{/if}
4045
{/await}
4146
<div class="flex justify-end">

0 commit comments

Comments
 (0)