From 8a9656e745d3ff6114e6048ad25f28b851851add Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:28:51 +0900 Subject: [PATCH 01/14] =?UTF-8?q?design:=20xSamll=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=97=90=20=EC=A4=84=EB=B0=94=EA=BF=88=20=EB=B0=A9=EC=A7=80=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/common/button/Button.style.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/common/button/Button.style.ts b/frontend/src/components/common/button/Button.style.ts index 5fa1da1ba..62e857cd0 100644 --- a/frontend/src/components/common/button/Button.style.ts +++ b/frontend/src/components/common/button/Button.style.ts @@ -71,6 +71,7 @@ const sizeStyles = { padding: 1rem 0.3rem; font: ${({ theme }) => theme.TEXT.semiSmall}; + white-space: nowrap; border-radius: 4px; `, From f7cdcda3518d75c8480a3323c6966068700e3f96 Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:30:16 +0900 Subject: [PATCH 02/14] =?UTF-8?q?feat:=20=EC=83=81=EC=84=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=EC=96=B4=EA=B0=80=20=EB=A6=AC=EB=B7=B0=20=EC=A4=91=EC=9D=B4?= =?UTF-8?q?=EC=97=90=EC=9A=94=20=EB=8C=80=EC=8B=A0=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EC=9E=AC=EC=B4=89=ED=95=98=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roomDetailPage/myReviewer/MyReviewer.style.ts | 9 +++++++++ .../components/roomDetailPage/myReviewer/MyReviewer.tsx | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.style.ts b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.style.ts index 13326f2df..71849f956 100644 --- a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.style.ts +++ b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.style.ts @@ -133,3 +133,12 @@ export const ExtraInformation = styled.span` font: ${({ theme }) => theme.TEXT.xSmall}; color: ${({ theme }) => theme.COLOR.grey2}; `; + +export const ContentWrapper = styled.div` + display: flex; + align-items: center; + justify-content: center; + + font: ${({ theme }) => theme.TEXT.semiSmall}; + color: ${({ theme }) => theme.COLOR.black}; +`; diff --git a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx index 8c05d39e4..f95d04de6 100644 --- a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx +++ b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx @@ -52,7 +52,9 @@ const MyReviewer = ({ roomInfo }: MyReviewerProps) => { {buttonText} ) : ( -

리뷰어가 리뷰 중이에요!

+ ); }; From e9f95f244b1aff965a56617b4b8eb7649651edd6 Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:31:29 +0900 Subject: [PATCH 03/14] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0=EC=9E=AC?= =?UTF-8?q?=EC=B4=89=ED=95=98=EA=B8=B0=20mutate=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/@types/alaram.ts | 5 +++++ frontend/src/apis/endpoints.ts | 1 + frontend/src/apis/reviews.api.ts | 12 ++++++++++++ .../roomDetailPage/myReviewee/MyReviewee.tsx | 4 ++-- frontend/src/constants/message.ts | 2 ++ frontend/src/hooks/mutations/useMutateReview.ts | 17 ++++++++++++++--- 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/frontend/src/@types/alaram.ts b/frontend/src/@types/alaram.ts index e5ae85900..2dbc01669 100644 --- a/frontend/src/@types/alaram.ts +++ b/frontend/src/@types/alaram.ts @@ -27,3 +27,8 @@ export interface AlarmAsRead { alarmId: number; alarmType: "USER"; } + +export interface RevieweReminderAlarm { + roomId: number; + reviewerId: number; +} diff --git a/frontend/src/apis/endpoints.ts b/frontend/src/apis/endpoints.ts index 4d0f2813a..b13ed146c 100644 --- a/frontend/src/apis/endpoints.ts +++ b/frontend/src/apis/endpoints.ts @@ -18,6 +18,7 @@ export const API_ENDPOINTS = { REVIEWERS: (roomId: number) => `/rooms/${roomId}/reviewers`, REVIEWEES: (roomId: number) => `/rooms/${roomId}/reviewees`, REVIEW_COMPLETE: "/review/complete", + REVIEW_URGE: "/review/urge", // profile PROFILE: "/user/profile", diff --git a/frontend/src/apis/reviews.api.ts b/frontend/src/apis/reviews.api.ts index 96c0fc4a0..df0a79962 100644 --- a/frontend/src/apis/reviews.api.ts +++ b/frontend/src/apis/reviews.api.ts @@ -1,6 +1,7 @@ import { ReviewInfo } from "../@types/review"; import apiClient from "./apiClient"; import { API_ENDPOINTS } from "./endpoints"; +import { RevieweReminderAlarm } from "@/@types/alaram"; import MESSAGES from "@/constants/message"; export const getMyReviewers = async (roomId: number): Promise => { @@ -31,3 +32,14 @@ export const postReviewComplete = async (roomId: number, revieweeId: number): Pr errorMessage: MESSAGES.ERROR.POST_REVIEW_COMPLETE, }); }; + +export const postReviewUrge = async ({ + roomId, + reviewerId, +}: RevieweReminderAlarm): Promise => { + return apiClient.post({ + endpoint: API_ENDPOINTS.REVIEW_URGE, + body: { roomId, reviewerId }, + errorMessage: MESSAGES.ERROR.POST_REVIEW_URGE, + }); +}; diff --git a/frontend/src/components/roomDetailPage/myReviewee/MyReviewee.tsx b/frontend/src/components/roomDetailPage/myReviewee/MyReviewee.tsx index f465f8679..895955edb 100644 --- a/frontend/src/components/roomDetailPage/myReviewee/MyReviewee.tsx +++ b/frontend/src/components/roomDetailPage/myReviewee/MyReviewee.tsx @@ -1,6 +1,6 @@ import { useState } from "react"; import { useNavigate } from "react-router-dom"; -import useMutateReviewComplete from "@/hooks/mutations/useMutateReview"; +import useMutateReview from "@/hooks/mutations/useMutateReview"; import { useFetchReviewee } from "@/hooks/queries/useFetchReviewee"; import Button from "@/components/common/button/Button"; import Icon from "@/components/common/icon/Icon"; @@ -18,7 +18,7 @@ interface MyRevieweeProps { const MyReviewee = ({ roomInfo }: MyRevieweeProps) => { const navigate = useNavigate(); const { data: revieweeData } = useFetchReviewee(roomInfo); - const { postReviewCompleteMutation } = useMutateReviewComplete(roomInfo.id); + const { postReviewCompleteMutation } = useMutateReview(roomInfo.id); const [loadingButtonId, setLoadingButtonId] = useState([]); // 피드백 페이지 이동 함수 diff --git a/frontend/src/constants/message.ts b/frontend/src/constants/message.ts index d1d884a09..523bbfc0e 100644 --- a/frontend/src/constants/message.ts +++ b/frontend/src/constants/message.ts @@ -42,6 +42,7 @@ const ERROR_MESSAGES = { POST_REVIEW_COMPLETE: "코드리뷰 완료 요청에 실패했습니다.", GET_MY_REVIEWERS: "리뷰어 목록을 불러오는 도중 에러가 발생하였습니다.", GET_MY_REVIEWEES: "리뷰이 목록을 불러오는 도중 에러가 발생하였습니다.", + POST_REVIEW_URGE: "코드리뷰 재촉하기에 실패했습니다.", // profile GET_PROFILE: "프로필 불러오는 도중 에러가 발생하였습니다.", @@ -81,6 +82,7 @@ const SUCCESS_MESSAGES = { DELETE_PARTICIPATE_IN: "정상적으로 방 참여를 취소하였습니다.", DELETE_PARTICIPATED_ROOM: "정상적으로 방을 삭제하였습니다.", PUT_REVIEW_FEEDBACK: "정상적으로 피드백을 수정하였습니다.", + POST_REVIEW_URGE: "정상적으로 코드리뷰 재촉하기를 했습니다.", }; const MESSAGES = { diff --git a/frontend/src/hooks/mutations/useMutateReview.ts b/frontend/src/hooks/mutations/useMutateReview.ts index dff0f8c93..eedd2e0fd 100644 --- a/frontend/src/hooks/mutations/useMutateReview.ts +++ b/frontend/src/hooks/mutations/useMutateReview.ts @@ -1,11 +1,12 @@ import useMutateHandlers from "./useMutateHandlers"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import useToast from "@/hooks/common/useToast"; +import { RevieweReminderAlarm } from "@/@types/alaram"; import QUERY_KEYS from "@/apis/queryKeys"; import { postReviewComplete } from "@/apis/reviews.api"; import MESSAGES from "@/constants/message"; -const useMutateReviewComplete = (roomId: number) => { +const useMutateReview = (roomId: number) => { const { handleMutateError } = useMutateHandlers(); const { openToast } = useToast("success"); @@ -21,7 +22,17 @@ const useMutateReviewComplete = (roomId: number) => { onError: (error) => handleMutateError(error), }); - return { postReviewCompleteMutation }; + const postReviewUrgeMutation = useMutation({ + mutationFn: ({ roomId, reviewerId }: RevieweReminderAlarm) => + postReviewComplete(roomId, reviewerId), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.REVIEWERS, roomId] }); + openToast(MESSAGES.SUCCESS.POST_REVIEW_URGE); + }, + onError: (error) => handleMutateError(error), + }); + + return { postReviewCompleteMutation, postReviewUrgeMutation }; }; -export default useMutateReviewComplete; +export default useMutateReview; From d33c07ade7cf6ba2c5bbcb184ce7a4e96ec1aa4f Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:32:20 +0900 Subject: [PATCH 04/14] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0=20=EC=9E=AC?= =?UTF-8?q?=EC=B4=89=ED=95=98=EA=B8=B0=20=EB=B2=84=ED=8A=BC=EC=97=90=20pos?= =?UTF-8?q?t=20=ED=95=A8=EC=88=98=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roomDetailPage/myReviewer/MyReviewer.tsx | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx index f95d04de6..0b46b5acb 100644 --- a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx +++ b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx @@ -1,4 +1,6 @@ +import { useState } from "react"; import { useNavigate } from "react-router-dom"; +import useMutateReview from "@/hooks/mutations/useMutateReview"; import { useFetchReviewer } from "@/hooks/queries/useFetchReviewer"; import Button from "@/components/common/button/Button"; import Icon from "@/components/common/icon/Icon"; @@ -17,6 +19,8 @@ interface MyReviewerProps { const MyReviewer = ({ roomInfo }: MyReviewerProps) => { const navigate = useNavigate(); const { data: reviewerData } = useFetchReviewer(roomInfo); + const { postReviewUrgeMutation } = useMutateReview(roomInfo.id); + const [loadingButtonId, setLoadingButtonId] = useState([]); // 피드백 페이지 이동 함수 const handleNavigateFeedbackPage = (reviewInfo: ReviewInfo) => { @@ -42,6 +46,23 @@ const MyReviewer = ({ roomInfo }: MyReviewerProps) => { // return

피드백을 작성하지 않았어요

; // } + // 코드리뷰 재촉 + const handleReviewUrgeClick = (reviewer: ReviewInfo) => { + if (loadingButtonId.includes(reviewer.userId)) return; + setLoadingButtonId((prev) => [...prev, reviewer.userId]); + console.log("click"); + + postReviewUrgeMutation.mutate( + { roomId: roomInfo.id, reviewerId: reviewer.userId }, + { + onSuccess: () => { + setLoadingButtonId((prev) => prev.filter((id) => id !== reviewer.userId)); + }, + onError: () => setLoadingButtonId((prev) => prev.filter((id) => id !== reviewer.userId)), + }, + ); + }; + return reviewer.isReviewed ? ( ) : ( - ); From 9bbf8de9ddd0e4abe0e51497d140a1d0a40de09a Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:33:42 +0900 Subject: [PATCH 05/14] =?UTF-8?q?chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=98=EC=86=94=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx index 0b46b5acb..a49d00451 100644 --- a/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx +++ b/frontend/src/components/roomDetailPage/myReviewer/MyReviewer.tsx @@ -50,7 +50,6 @@ const MyReviewer = ({ roomInfo }: MyReviewerProps) => { const handleReviewUrgeClick = (reviewer: ReviewInfo) => { if (loadingButtonId.includes(reviewer.userId)) return; setLoadingButtonId((prev) => [...prev, reviewer.userId]); - console.log("click"); postReviewUrgeMutation.mutate( { roomId: roomInfo.id, reviewerId: reviewer.userId }, From 340366858a183db39cf14bb9a00c591857f6be1a Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:54:46 +0900 Subject: [PATCH 06/14] =?UTF-8?q?feat:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EC=9E=AC=EC=B4=89=EC=97=90=20=EB=8C=80=ED=95=9C=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/@types/alaram.ts | 4 +++- frontend/src/pages/alarm/AlarmPage.tsx | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/src/@types/alaram.ts b/frontend/src/@types/alaram.ts index 2dbc01669..7e8b8739b 100644 --- a/frontend/src/@types/alaram.ts +++ b/frontend/src/@types/alaram.ts @@ -1,10 +1,12 @@ +export type AlarmActionType = "REVIEW_COMPLETE" | "REVIEW_URGE"; + export interface AlarmCount { count: number; } export interface AlarmItemData { alarmId: number; - actionType: string; + actionType: AlarmActionType; actor: { memberId: number; username: string; diff --git a/frontend/src/pages/alarm/AlarmPage.tsx b/frontend/src/pages/alarm/AlarmPage.tsx index e2c900248..a30ef1c44 100644 --- a/frontend/src/pages/alarm/AlarmPage.tsx +++ b/frontend/src/pages/alarm/AlarmPage.tsx @@ -29,7 +29,17 @@ const AlarmPage = () => { if (actionType === "REVIEW_COMPLETE") { return ( <> - {username} 님이 {info} 미션에 대해 코드리뷰를 완료했습니다. + {username} 님이 {info} 미션에 대해 코드리뷰를 완료 + 했습니다. + + ); + } + + if (actionType === "REVIEW_URGE") { + return ( + <> + {username} 님이 {info} 미션에 대해 코드리뷰를 재촉 + 했습니다. ); } @@ -40,6 +50,10 @@ const AlarmPage = () => { if (actionType === "REVIEW_COMPLETE") { return `/rooms/${interactionId}`; } + + if (actionType === "REVIEW_URGE") { + return `/rooms/${interactionId}`; + } return ""; }; From 2a478aa04d65f18f4e90c609a1011f3a99e7f1f4 Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:57:52 +0900 Subject: [PATCH 07/14] =?UTF-8?q?feat:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EC=9E=AC=EC=B4=89=EC=8B=9C=20=EC=95=8C=EB=A6=BC=20?= =?UTF-8?q?=EB=AC=B4=ED=9A=A8=ED=99=94=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/mutations/useMutateReview.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/hooks/mutations/useMutateReview.ts b/frontend/src/hooks/mutations/useMutateReview.ts index eedd2e0fd..c736a956f 100644 --- a/frontend/src/hooks/mutations/useMutateReview.ts +++ b/frontend/src/hooks/mutations/useMutateReview.ts @@ -26,7 +26,9 @@ const useMutateReview = (roomId: number) => { mutationFn: ({ roomId, reviewerId }: RevieweReminderAlarm) => postReviewComplete(roomId, reviewerId), onSuccess: () => { - queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.REVIEWERS, roomId] }); + queryClient.invalidateQueries({ + queryKey: [QUERY_KEYS.REVIEWERS, roomId, QUERY_KEYS.ALARM_COUNT, QUERY_KEYS.ALARM_LIST], + }); openToast(MESSAGES.SUCCESS.POST_REVIEW_URGE); }, onError: (error) => handleMutateError(error), From 3ee3f01bde89516db4dde520238ba5eae6f280a6 Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 12:59:51 +0900 Subject: [PATCH 08/14] =?UTF-8?q?feat:=20=EC=95=8C=EB=A6=BC=20=EB=AA=A8?= =?UTF-8?q?=ED=82=B9=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/mocks/mockResponse/alarmInfos.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/mocks/mockResponse/alarmInfos.json b/frontend/src/mocks/mockResponse/alarmInfos.json index 5de05c472..c0ff3d97a 100644 --- a/frontend/src/mocks/mockResponse/alarmInfos.json +++ b/frontend/src/mocks/mockResponse/alarmInfos.json @@ -47,6 +47,22 @@ "isRead": false, "createAt": "2024-1008T00:01:59.4122", "alarmType": "USER" + }, + { + "alarmId": 3, + "actionType": "REVIEW_URGE", + "actor": { + "memberId": 2, + "username": "ashs", + "thumbnailUrl": "www.myProfile.jpg" + }, + "interaction": { + "interactionId": 1, + "info": "TDD 자바 TDD 자바 TDD 자바[]" + }, + "isRead": false, + "createAt": "2024-1008T00:01:59.4122", + "alarmType": "USER" } ] } From b6d2eb121f4367648d8259e6d4bd9313753dbc86 Mon Sep 17 00:00:00 2001 From: 00kang Date: Tue, 12 Nov 2024 14:10:37 +0900 Subject: [PATCH 09/14] =?UTF-8?q?fix:=20=EB=A6=AC=EB=B7=B0=EC=9E=AC?= =?UTF-8?q?=EC=B4=89=20post=ED=95=A8=EC=88=98=20=EC=9E=98=EB=AA=BB=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=ED=95=9C=20=EC=98=A4=EB=A5=98=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/mutations/useMutateReview.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/mutations/useMutateReview.ts b/frontend/src/hooks/mutations/useMutateReview.ts index c736a956f..328c8eb81 100644 --- a/frontend/src/hooks/mutations/useMutateReview.ts +++ b/frontend/src/hooks/mutations/useMutateReview.ts @@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import useToast from "@/hooks/common/useToast"; import { RevieweReminderAlarm } from "@/@types/alaram"; import QUERY_KEYS from "@/apis/queryKeys"; -import { postReviewComplete } from "@/apis/reviews.api"; +import { postReviewComplete, postReviewUrge } from "@/apis/reviews.api"; import MESSAGES from "@/constants/message"; const useMutateReview = (roomId: number) => { @@ -24,7 +24,7 @@ const useMutateReview = (roomId: number) => { const postReviewUrgeMutation = useMutation({ mutationFn: ({ roomId, reviewerId }: RevieweReminderAlarm) => - postReviewComplete(roomId, reviewerId), + postReviewUrge({ roomId, reviewerId }), onSuccess: () => { queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.REVIEWERS, roomId, QUERY_KEYS.ALARM_COUNT, QUERY_KEYS.ALARM_LIST], From 83a8c01e7ddae3a1ac527deb1f10012c01804622 Mon Sep 17 00:00:00 2001 From: 00kang Date: Wed, 13 Nov 2024 17:32:08 +0900 Subject: [PATCH 10/14] =?UTF-8?q?feat:=20RevieweReminderAlarm=20->=20Revie?= =?UTF-8?q?wReminderAlarm=20=EC=9C=BC=EB=A1=9C=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/@types/alaram.ts | 2 +- frontend/src/apis/reviews.api.ts | 4 ++-- frontend/src/hooks/mutations/useMutateReview.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/@types/alaram.ts b/frontend/src/@types/alaram.ts index 7e8b8739b..01f145648 100644 --- a/frontend/src/@types/alaram.ts +++ b/frontend/src/@types/alaram.ts @@ -30,7 +30,7 @@ export interface AlarmAsRead { alarmType: "USER"; } -export interface RevieweReminderAlarm { +export interface ReviewReminderAlarm { roomId: number; reviewerId: number; } diff --git a/frontend/src/apis/reviews.api.ts b/frontend/src/apis/reviews.api.ts index df0a79962..6502518dd 100644 --- a/frontend/src/apis/reviews.api.ts +++ b/frontend/src/apis/reviews.api.ts @@ -1,7 +1,7 @@ import { ReviewInfo } from "../@types/review"; import apiClient from "./apiClient"; import { API_ENDPOINTS } from "./endpoints"; -import { RevieweReminderAlarm } from "@/@types/alaram"; +import { ReviewReminderAlarm } from "@/@types/alaram"; import MESSAGES from "@/constants/message"; export const getMyReviewers = async (roomId: number): Promise => { @@ -36,7 +36,7 @@ export const postReviewComplete = async (roomId: number, revieweeId: number): Pr export const postReviewUrge = async ({ roomId, reviewerId, -}: RevieweReminderAlarm): Promise => { +}: ReviewReminderAlarm): Promise => { return apiClient.post({ endpoint: API_ENDPOINTS.REVIEW_URGE, body: { roomId, reviewerId }, diff --git a/frontend/src/hooks/mutations/useMutateReview.ts b/frontend/src/hooks/mutations/useMutateReview.ts index 328c8eb81..a9f5d8ef6 100644 --- a/frontend/src/hooks/mutations/useMutateReview.ts +++ b/frontend/src/hooks/mutations/useMutateReview.ts @@ -1,7 +1,7 @@ import useMutateHandlers from "./useMutateHandlers"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import useToast from "@/hooks/common/useToast"; -import { RevieweReminderAlarm } from "@/@types/alaram"; +import { ReviewReminderAlarm } from "@/@types/alaram"; import QUERY_KEYS from "@/apis/queryKeys"; import { postReviewComplete, postReviewUrge } from "@/apis/reviews.api"; import MESSAGES from "@/constants/message"; @@ -23,7 +23,7 @@ const useMutateReview = (roomId: number) => { }); const postReviewUrgeMutation = useMutation({ - mutationFn: ({ roomId, reviewerId }: RevieweReminderAlarm) => + mutationFn: ({ roomId, reviewerId }: ReviewReminderAlarm) => postReviewUrge({ roomId, reviewerId }), onSuccess: () => { queryClient.invalidateQueries({ From 0710f7c43bc667dbd6ca54bf48e51b318e85ea08 Mon Sep 17 00:00:00 2001 From: 00kang Date: Wed, 13 Nov 2024 17:37:30 +0900 Subject: [PATCH 11/14] =?UTF-8?q?refactor:=20postRevieUrge=EC=9D=98=20inva?= =?UTF-8?q?lidaQuery=20=EA=B0=81=EA=B0=81=EC=9C=BC=EB=A1=9C=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/mutations/useMutateReview.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/hooks/mutations/useMutateReview.ts b/frontend/src/hooks/mutations/useMutateReview.ts index a9f5d8ef6..eeab01cac 100644 --- a/frontend/src/hooks/mutations/useMutateReview.ts +++ b/frontend/src/hooks/mutations/useMutateReview.ts @@ -27,7 +27,13 @@ const useMutateReview = (roomId: number) => { postReviewUrge({ roomId, reviewerId }), onSuccess: () => { queryClient.invalidateQueries({ - queryKey: [QUERY_KEYS.REVIEWERS, roomId, QUERY_KEYS.ALARM_COUNT, QUERY_KEYS.ALARM_LIST], + queryKey: [QUERY_KEYS.REVIEWERS, roomId], + }); + queryClient.invalidateQueries({ + queryKey: [QUERY_KEYS.ALARM_COUNT], + }); + queryClient.invalidateQueries({ + queryKey: [QUERY_KEYS.ALARM_LIST], }); openToast(MESSAGES.SUCCESS.POST_REVIEW_URGE); }, From 27929b4e00b0998c24fdf4a76df64075c7f07443 Mon Sep 17 00:00:00 2001 From: 00kang Date: Wed, 13 Nov 2024 17:38:26 +0900 Subject: [PATCH 12/14] =?UTF-8?q?feat:=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EC=9E=AC=EC=B4=89=ED=95=98=EA=B8=B0=20->=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0=20=EC=9E=AC=EC=B4=89=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=EC=9C=BC=EB=A1=9C=20=EB=AC=B8=EA=B5=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/constants/message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/constants/message.ts b/frontend/src/constants/message.ts index 523bbfc0e..0438fa5a3 100644 --- a/frontend/src/constants/message.ts +++ b/frontend/src/constants/message.ts @@ -42,7 +42,7 @@ const ERROR_MESSAGES = { POST_REVIEW_COMPLETE: "코드리뷰 완료 요청에 실패했습니다.", GET_MY_REVIEWERS: "리뷰어 목록을 불러오는 도중 에러가 발생하였습니다.", GET_MY_REVIEWEES: "리뷰이 목록을 불러오는 도중 에러가 발생하였습니다.", - POST_REVIEW_URGE: "코드리뷰 재촉하기에 실패했습니다.", + POST_REVIEW_URGE: "코드리뷰 재촉 요청에 실패했습니다.", // profile GET_PROFILE: "프로필 불러오는 도중 에러가 발생하였습니다.", From ab1505582519d0b5ddd8fa500e0568d2ba7c2b70 Mon Sep 17 00:00:00 2001 From: 00kang Date: Wed, 13 Nov 2024 17:45:51 +0900 Subject: [PATCH 13/14] =?UTF-8?q?refactor:=20postReviewComplete=EB=8F=84?= =?UTF-8?q?=20invalid=20queryKey=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/hooks/mutations/useMutateReview.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/hooks/mutations/useMutateReview.ts b/frontend/src/hooks/mutations/useMutateReview.ts index eeab01cac..5b3f208dc 100644 --- a/frontend/src/hooks/mutations/useMutateReview.ts +++ b/frontend/src/hooks/mutations/useMutateReview.ts @@ -17,6 +17,12 @@ const useMutateReview = (roomId: number) => { postReviewComplete(roomId, revieweeId), onSuccess: () => { queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.REVIEWEES, roomId] }); + queryClient.invalidateQueries({ + queryKey: [QUERY_KEYS.ALARM_COUNT], + }); + queryClient.invalidateQueries({ + queryKey: [QUERY_KEYS.ALARM_LIST], + }); openToast(MESSAGES.SUCCESS.POST_REVIEW_COMPLETE); }, onError: (error) => handleMutateError(error), From dab3fcc08b186162cb50434b072070e7887589d9 Mon Sep 17 00:00:00 2001 From: 00kang Date: Wed, 13 Nov 2024 17:54:05 +0900 Subject: [PATCH 14/14] =?UTF-8?q?refactor:=20RoomCard=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/shared/roomCard/RoomCard.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/shared/roomCard/RoomCard.tsx b/frontend/src/components/shared/roomCard/RoomCard.tsx index 0800c8e40..78c3418f8 100644 --- a/frontend/src/components/shared/roomCard/RoomCard.tsx +++ b/frontend/src/components/shared/roomCard/RoomCard.tsx @@ -1,10 +1,9 @@ /* eslint-disable react/display-name */ -import React, { useState } from "react"; +import React from "react"; import useModal from "@/hooks/common/useModal"; import Icon from "@/components/common/icon/Icon"; import ImageWithFallback from "@/components/common/img/ImageWithFallback"; import Label from "@/components/common/label/Label"; -import ConfirmModal from "@/components/common/modal/confirmModal/ConfirmModal"; import ClassificationBadge from "@/components/shared/classificationBadge/ClassificationBadge"; import * as S from "@/components/shared/roomCard/RoomCard.style"; import RoomCardModal from "@/components/shared/roomCardModal/RoomCardModal"; @@ -74,11 +73,7 @@ const RoomCard = React.memo(({ roomInfo }: RoomCardProps) => { <> - +