fix: eslint

This commit is contained in:
SquidSpirit 2025-10-14 21:27:48 +08:00
parent d569f35bc1
commit df5bba022e
6 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,9 @@
import { CreatePostRequestDto } from '$lib/post/adapter/gateway/creatPostRequestDto';
import type { PostApiService } from '$lib/post/adapter/gateway/postApiService';
import type { CreatePostParams, PostRepository } from '$lib/post/application/gateway/postRepository';
import type {
CreatePostParams,
PostRepository,
} from '$lib/post/application/gateway/postRepository';
import type { Post } from '$lib/post/domain/entity/post';
import type { PostInfo } from '$lib/post/domain/entity/postInfo';

View File

@ -38,8 +38,7 @@ export class PostBloc {
case PostEventType.PostLoadedEvent:
return this.loadPost(event.id);
case PostEventType.PostCreatedEvent:
const { semanticId, title } = event;
return this.createPost({ semanticId, title });
return this.createPost(event.params);
}
}
@ -95,6 +94,5 @@ interface PostLoadedEvent {
interface PostCreatedEvent {
event: PostEventType.PostCreatedEvent;
semanticId: string;
title: string;
params: CreatePostParams;
}

View File

@ -6,7 +6,7 @@
.string()
.max(100)
.regex(/\D/)
.regex(/^[a-zA-Z0-9_\-]+$/),
.regex(/^[a-zA-Z0-9_-]+$/),
title: z.string().trim().nonempty().max(100),
});

View File

@ -1,5 +1,4 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { StatusType } from '$lib/common/adapter/presenter/asyncState';
import { PostBloc, PostEventType } from '$lib/post/adapter/presenter/postBloc';
import CreatePostDialog, {
@ -14,7 +13,7 @@
const isLoading = $derived(state.status === StatusType.Loading);
async function onCreatePostDialogSubmit(params: CreatePostDialogFormParams) {
const state = await postBloc.dispatch({ event: PostEventType.PostCreatedEvent, ...params });
const state = await postBloc.dispatch({ event: PostEventType.PostCreatedEvent, params });
if (state.status === StatusType.Success) {
toast.success(`Post created successfully with ID: ${state.data.id}`);

View File

@ -36,7 +36,7 @@
{:else if !isAuthenticated}
<ErrorPage />
{:else}
<div class="min-h-content-height grid grid-cols-[auto_1fr]">
<div class="grid min-h-content-height grid-cols-[auto_1fr]">
<DashboardNavbar {links} />
{@render children()}
</div>