From 72ded702f2cbca0765f7d33da01c015cd886b52c Mon Sep 17 00:00:00 2001 From: sunny <67677561+sunhpark42@users.noreply.github.com> Date: Sun, 27 Feb 2022 20:38:08 +0900 Subject: [PATCH] =?UTF-8?q?hotfix(FE):=20=ED=95=99=EC=8A=B5=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=82=AD=EC=A0=9C=EC=8B=9C=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=8A=B8=20=EB=B0=8F=20=EC=84=B1=EA=B3=B5=20=EB=A9=94=EC=84=B8?= =?UTF-8?q?=EC=A7=80=EA=B0=80=20=EB=85=B8=EC=B6=9C=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0=20?= =?UTF-8?q?(#696)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 학습로그 삭제 성공시 학습로그 목록으로 이동로직 추가 * feat: 삭제 성공시 성공 안내 메세지 추가 --- frontend/src/constants/message.js | 1 + frontend/src/pages/StudylogPage/index.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/frontend/src/constants/message.js b/frontend/src/constants/message.js index 0b93ddc03..9b07d1e7a 100644 --- a/frontend/src/constants/message.js +++ b/frontend/src/constants/message.js @@ -42,6 +42,7 @@ const ERROR_MESSAGE = { const SUCCESS_MESSAGE = { CREATE_POST: '글이 작성되었습니다.', + DELETE_STUDYLOG: '글이 삭제되었습니다.', CREATE_ABILITY: '역량을 추가했습니다.', EDIT_ABILITY: '역량을 수정했습니다.', DELETE_ABILITY: '역량을 삭제했습니다.', diff --git a/frontend/src/pages/StudylogPage/index.js b/frontend/src/pages/StudylogPage/index.js index 580fb4706..f9740ee59 100644 --- a/frontend/src/pages/StudylogPage/index.js +++ b/frontend/src/pages/StudylogPage/index.js @@ -29,6 +29,7 @@ import { PATH, SNACKBAR_MESSAGE, } from '../../constants'; +import { SUCCESS_MESSAGE } from '../../constants/message'; const StudylogPage = () => { const { id } = useParams(); @@ -49,6 +50,10 @@ const StudylogPage = () => { return requestDeleteStudylog({ id, accessToken }); }, { + onSuccess: () => { + openSnackBar(SUCCESS_MESSAGE.DELETE_STUDYLOG); + history.push(PATH.STUDYLOG); + }, onError: (error) => { alert(ERROR_MESSAGE[error.code] ?? ALERT_MESSAGE.FAIL_TO_DELETE_STUDYLOG); },