diff --git a/BE/src/post/post.service.ts b/BE/src/post/post.service.ts index e7056c1..7603491 100644 --- a/BE/src/post/post.service.ts +++ b/BE/src/post/post.service.ts @@ -10,6 +10,10 @@ import { PostListDto } from './dto/postList.dto'; import { BlockUserEntity } from '../entities/blockUser.entity'; import { BlockPostEntity } from '../entities/blockPost.entity'; +interface WhereOption { + is_request?: boolean; + user_hash?: string; +} @Injectable() export class PostService { constructor( @@ -25,11 +29,14 @@ export class PostService { private blockPostRepository: Repository, private s3Handler: S3Handler, ) {} - makeWhereOption(query: PostListDto) { - const where = { is_request: undefined }; + makeWhereOption(query: PostListDto): WhereOption { + const where: WhereOption = {}; if (query.requestFilter !== undefined) { where.is_request = query.requestFilter !== 0; } + if (query.writer !== undefined) { + where.user_hash = query.writer; + } return where; }