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); },