From 154855e26528d07cc2aa7a7bc1fef6aee56edb34 Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Sat, 9 Dec 2023 22:08:22 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[BE]=20Feat=20:=20=EC=88=A8=EA=B8=B4=20?= =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EB=A6=AC=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EC=97=90=20=EB=8C=80=EC=97=AC=EA=B8=B0=EA=B0=84,=20=EA=B8=80?= =?UTF-8?q?=EC=9D=98=20=EC=A2=85=EB=A5=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/posts-block/posts-block.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BE/src/posts-block/posts-block.service.ts b/BE/src/posts-block/posts-block.service.ts index f6d569c..20cbd3f 100644 --- a/BE/src/posts-block/posts-block.service.ts +++ b/BE/src/posts-block/posts-block.service.ts @@ -52,6 +52,9 @@ export class PostsBlockService { title: blockedPost.title, post_image: blockedPost.thumbnail, post_id: blockedPost.id, + start_date: blockedPost.start_date, + end_date: blockedPost.end_date, + is_request: blockedPost.is_request, }; }); } From 001402106be10b3b929761d91e7c4f91afef831d Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Sat, 9 Dec 2023 22:57:33 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[BE]=20Feat=20:=20=EB=8B=A4=EB=A5=B8=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=EB=A1=9C=EB=8F=84=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=EC=9E=90=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/login/login.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BE/src/login/login.controller.ts b/BE/src/login/login.controller.ts index 069a830..9eafbf2 100644 --- a/BE/src/login/login.controller.ts +++ b/BE/src/login/login.controller.ts @@ -5,6 +5,7 @@ import { Headers, HttpException, Post, + Query, UseGuards, } from '@nestjs/common'; import { LoginService, SocialProperties } from './login.service'; @@ -37,7 +38,7 @@ export class LoginController { } @Post('login/admin') - loginAdmin(@Body('user') user) { + loginAdmin(@Query('user') user) { return this.loginService.loginAdmin(user); } From 8827b07280bbdb520fc1cbc3ca64d451b19db311 Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Sat, 9 Dec 2023 22:58:07 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[BE]=20Feat=20:=20=EA=B8=80=EC=9D=98=20?= =?UTF-8?q?=EC=A2=85=EB=A5=98=20=ED=95=84=ED=84=B0=EB=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/posts-block/posts-block.controller.ts | 11 +++++++++-- BE/src/posts-block/posts-block.service.ts | 10 +++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/BE/src/posts-block/posts-block.controller.ts b/BE/src/posts-block/posts-block.controller.ts index 8957461..90ff87a 100644 --- a/BE/src/posts-block/posts-block.controller.ts +++ b/BE/src/posts-block/posts-block.controller.ts @@ -4,6 +4,7 @@ import { Get, Param, Post, + Query, UseGuards, } from '@nestjs/common'; import { PostsBlockService } from './posts-block.service'; @@ -23,8 +24,14 @@ export class PostsBlockController { } @Get() - async postsBlockList(@UserHash() blockerId: string) { - return await this.postsBlockService.findBlockedPosts(blockerId); + async postsBlockList( + @UserHash() blockerId: string, + @Query('requestFilter') requestFilter, + ) { + return await this.postsBlockService.findBlockedPosts( + blockerId, + parseInt(requestFilter), + ); } @Delete(':id') diff --git a/BE/src/posts-block/posts-block.service.ts b/BE/src/posts-block/posts-block.service.ts index 20cbd3f..f0e6e4e 100644 --- a/BE/src/posts-block/posts-block.service.ts +++ b/BE/src/posts-block/posts-block.service.ts @@ -39,10 +39,11 @@ export class PostsBlockService { await this.blockPostRepository.save(blockPostEntity); } - async findBlockedPosts(blockerId: string) { + async findBlockedPosts(blockerId: string, requestFilter: number) { const blockLists = await this.blockPostRepository.find({ where: { blocker: blockerId, + blockedPost: this.getRequestFilter(requestFilter), }, relations: ['blockedPost'], }); @@ -59,6 +60,13 @@ export class PostsBlockService { }); } + getRequestFilter(requestFilter: number) { + if (requestFilter === undefined) { + return undefined; + } + return { is_request: requestFilter === 1 }; + } + async removeBlockPosts(blockedPostId: number, userId: string) { const blockedPost = await this.blockPostRepository.findOne({ where: { blocked_post: blockedPostId, blocker: userId }, From 52020212d8cafdfecea28512bc58f6a9d716c3f1 Mon Sep 17 00:00:00 2001 From: koomin1227 Date: Sat, 9 Dec 2023 23:08:15 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[BE]=20Feat=20:=20=EC=88=A8=EA=B8=B4=20?= =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EC=9D=91=EB=8B=B5=EC=97=90=20?= =?UTF-8?q?=EA=B0=80=EA=B2=A9=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/posts-block/posts-block.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/BE/src/posts-block/posts-block.service.ts b/BE/src/posts-block/posts-block.service.ts index f0e6e4e..59ed6dc 100644 --- a/BE/src/posts-block/posts-block.service.ts +++ b/BE/src/posts-block/posts-block.service.ts @@ -56,6 +56,7 @@ export class PostsBlockService { start_date: blockedPost.start_date, end_date: blockedPost.end_date, is_request: blockedPost.is_request, + price: blockedPost.price, }; }); }