blog/frontend/src/lib/post/application/useCase/getAllPostsUseCase.ts
SquidSpirit 5890d6c39c
Some checks failed
Frontend CI / build (push) Failing after 1m13s
Auto Comment On PR / add_improve_comment (pull_request) Successful in 17s
PR Title Check / pr-title-check (pull_request) Successful in 16s
feat: enhance post listing functionality with unpublished post visibility option
2025-10-15 04:06:11 +08:00

11 lines
381 B
TypeScript

import type { PostRepository } from '$lib/post/application/gateway/postRepository';
import type { PostInfo } from '$lib/post/domain/entity/postInfo';
export class GetAllPostsUseCase {
constructor(private readonly postRepository: PostRepository) {}
execute(showUnpublished: boolean = false): Promise<PostInfo[]> {
return this.postRepository.getAllPosts(showUnpublished);
}
}