BLOG-140 Label management (list and create) #144
@ -26,6 +26,7 @@
|
|||||||
const state = await createPost(params);
|
const state = await createPost(params);
|
||||||
|
|
||||||
if (state.isSuccess()) {
|
if (state.isSuccess()) {
|
||||||
|
loadPosts({ showUnpublished: true });
|
||||||
toast.success(`Post created successfully with ID: ${state.data.id}`);
|
toast.success(`Post created successfully with ID: ${state.data.id}`);
|
||||||
} else if (state.isError()) {
|
} else if (state.isError()) {
|
||||||
toast.error('Failed to create post', {
|
toast.error('Failed to create post', {
|
||||||
@ -56,13 +57,15 @@
|
|||||||
{#each postsListedState.data as postInfo (postInfo.id)}
|
{#each postsListedState.data as postInfo (postInfo.id)}
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>{postInfo.id}</TableCell>
|
<TableCell>{postInfo.id}</TableCell>
|
||||||
<TableCell>{postInfo.title}</TableCell>
|
<TableCell><span class="text-wrap">{postInfo.title}</span></TableCell>
|
||||||
<TableCell class="flex flex-row flex-wrap gap-2">
|
<TableCell>
|
||||||
{#each postInfo.labels as label (label.id)}
|
<div class="flex flex-row flex-wrap gap-2">
|
||||||
<PostLabel {label} />
|
{#each postInfo.labels as label (label.id)}
|
||||||
{/each}
|
<PostLabel {label} />
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{postInfo.formattedPublishedTime || '---'}</TableCell>
|
<TableCell>{postInfo.formattedPublishedTime}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user