Skip to content

Commit 72ded70

Browse files
authored
hotfix(FE): 학습로그 삭제시 라우트 및 성공 메세지가 노출되지 않는 이슈 해결 (#696)
* fix: 학습로그 삭제 성공시 학습로그 목록으로 이동로직 추가 * feat: 삭제 성공시 성공 안내 메세지 추가
1 parent d410c44 commit 72ded70

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

frontend/src/constants/message.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const ERROR_MESSAGE = {
4242

4343
const SUCCESS_MESSAGE = {
4444
CREATE_POST: '글이 작성되었습니다.',
45+
DELETE_STUDYLOG: '글이 삭제되었습니다.',
4546
CREATE_ABILITY: '역량을 추가했습니다.',
4647
EDIT_ABILITY: '역량을 수정했습니다.',
4748
DELETE_ABILITY: '역량을 삭제했습니다.',

frontend/src/pages/StudylogPage/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
PATH,
3030
SNACKBAR_MESSAGE,
3131
} from '../../constants';
32+
import { SUCCESS_MESSAGE } from '../../constants/message';
3233

3334
const StudylogPage = () => {
3435
const { id } = useParams();
@@ -49,6 +50,10 @@ const StudylogPage = () => {
4950
return requestDeleteStudylog({ id, accessToken });
5051
},
5152
{
53+
onSuccess: () => {
54+
openSnackBar(SUCCESS_MESSAGE.DELETE_STUDYLOG);
55+
history.push(PATH.STUDYLOG);
56+
},
5257
onError: (error) => {
5358
alert(ERROR_MESSAGE[error.code] ?? ALERT_MESSAGE.FAIL_TO_DELETE_STUDYLOG);
5459
},

0 commit comments

Comments
 (0)