Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/pages/admin/board/EgovAdminBoardEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ function EgovAdminBoardEdit(props) {
}
};

const handleDelete = (bbsId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

deleteBoardArticle(bbsId);
};

const deleteBoardArticle = (bbsId) => {
const deleteBoardURL = `/bbsMaster/${bbsId}`;

Expand Down Expand Up @@ -487,7 +495,7 @@ function EgovAdminBoardEdit(props) {
<button
className="btn btn_skyblue_h46 w_100"
onClick={() => {
deleteBoardArticle(boardDetail.bbsId);
handleDelete(boardDetail.bbsId);
}}
>
삭제
Expand Down
10 changes: 9 additions & 1 deletion src/pages/admin/gallery/EgovAdminGalleryDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ function EgovAdminGalleryDetail(props) {
});
};

const handleDelete = (bbsId, nttId, atchFileId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

onClickDeleteBoardArticle(bbsId, nttId, atchFileId);
}

const onClickDeleteBoardArticle = (bbsId, nttId, atchFileId) => {
const deleteBoardURL = `/board/${bbsId}/${nttId}`;

Expand Down Expand Up @@ -172,7 +180,7 @@ function EgovAdminGalleryDetail(props) {
className="btn btn_skyblue_h46 w_100"
onClick={(e) => {
e.preventDefault();
onClickDeleteBoardArticle(
handleDelete(
boardDetail.bbsId,
boardDetail.nttId,
boardDetail.atchFileId
Expand Down
10 changes: 9 additions & 1 deletion src/pages/admin/members/EgovAdminMemberEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ function EgovAdminMemberEdit(props) {
}
};

const handleDelete = (uniqId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

deleteMember(uniqId);
}

const deleteMember = (uniqId) => {
const deleteMemberURL = `/members/delete/${uniqId}`;

Expand Down Expand Up @@ -481,7 +489,7 @@ function EgovAdminMemberEdit(props) {
<button
className="btn btn_skyblue_h46 w_100"
onClick={() => {
deleteMember(memberDetail.uniqId);
handleDelete(memberDetail.uniqId);
}}
>
삭제
Expand Down
10 changes: 9 additions & 1 deletion src/pages/admin/notice/EgovAdminNoticeDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ function EgovAdminNoticeDetail(props) {
});
};

const handleDelete = (bbsId, nttId, atchFileId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

onClickDeleteBoardArticle(bbsId, nttId, atchFileId);
}

const onClickDeleteBoardArticle = (bbsId, nttId, atchFileId) => {
const deleteBoardURL = `/board/${bbsId}/${nttId}`;

Expand Down Expand Up @@ -167,7 +175,7 @@ function EgovAdminNoticeDetail(props) {
className="btn btn_skyblue_h46 w_100"
onClick={(e) => {
e.preventDefault();
onClickDeleteBoardArticle(
handleDelete(
boardDetail.bbsId,
boardDetail.nttId,
boardDetail.atchFileId
Expand Down
10 changes: 9 additions & 1 deletion src/pages/admin/schedule/EgovAdminScheduleDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ function EgovAdminScheduleDetail(props) {
});
};

const handleDelete = (schdulId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

onClickDeleteSchedule(schdulId);
}

const onClickDeleteSchedule = (schdulId) => {
const deleteBoardURL = `/schedule/${schdulId}`;

Expand Down Expand Up @@ -209,7 +217,7 @@ function EgovAdminScheduleDetail(props) {
<button
className="btn btn_skyblue_h46 w_100"
onClick={() => {
onClickDeleteSchedule(location.state?.schdulId);
handleDelete(location.state?.schdulId);
}}
>
삭제
Expand Down
10 changes: 9 additions & 1 deletion src/pages/inform/gallery/EgovGalleryDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ function EgovGalleryDetail(props) {
});
};

const handleDelete = (bbsId, nttId, atchFileId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

onClickDeleteBoardArticle(bbsId, nttId, atchFileId);
};

const onClickDeleteBoardArticle = (bbsId, nttId, atchFileId) => {
const deleteBoardURL = `/board/${bbsId}/${nttId}`;

Expand Down Expand Up @@ -180,7 +188,7 @@ function EgovGalleryDetail(props) {
className="btn btn_skyblue_h46 w_100"
onClick={(e) => {
e.preventDefault();
onClickDeleteBoardArticle(
handleDelete(
boardDetail.bbsId,
boardDetail.nttId,
boardDetail.atchFileId
Expand Down
10 changes: 9 additions & 1 deletion src/pages/inform/notice/EgovNoticeDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ function EgovNoticeDetail(props) {
});
};

const handleDelete = (bbsId, nttId, atchFileId) => {
if (!window.confirm("정말 삭제하시겠습니까?")) {
return;
}

onClickDeleteBoardArticle(bbsId, nttId, atchFileId);
};

const onClickDeleteBoardArticle = (bbsId, nttId, atchFileId) => {
const deleteBoardURL = `/board/${bbsId}/${nttId}`;

Expand Down Expand Up @@ -174,7 +182,7 @@ function EgovNoticeDetail(props) {
className="btn btn_skyblue_h46 w_100"
onClick={(e) => {
e.preventDefault();
onClickDeleteBoardArticle(
handleDelete(
boardDetail.bbsId,
boardDetail.nttId,
boardDetail.atchFileId
Expand Down
13 changes: 10 additions & 3 deletions src/pages/mypage/EgovMypageEdit.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef } from "react";
import { useNavigate, useLocation } from "react-router-dom"; //Link, 제거
import { useNavigate } from "react-router-dom"; //Link, 제거

import * as EgovNet from "@/api/egovFetch";
import URL from "@/constants/url";
Expand All @@ -11,7 +11,6 @@ import { useAuth } from "@/contexts/AuthContext";
function EgovMypageEdit(props) {
const { clear } = useAuth();
const navigate = useNavigate();
const location = useLocation();
const checkRef = useRef([]);
//const uniqId = location.state?.uniqId || "";
const [modeInfo, setModeInfo] = useState({ mode: props.mode });
Expand Down Expand Up @@ -232,6 +231,14 @@ function EgovMypageEdit(props) {
}
};

const handleDelete = () => {
if (!window.confirm("정말 회원 탈퇴하시겠습니까?")) {
return;
}

deleteMember();
};

const deleteMember = () => {
if (formObjValidator(checkRef)) {
const deleteMypageURL = `/mypage/delete`; // /${uniqId} 제거 서버단에서 토큰 값 사용.
Expand Down Expand Up @@ -443,7 +450,7 @@ function EgovMypageEdit(props) {
<button
className="btn btn_skyblue_h46 w_100"
onClick={() => {
deleteMember();
handleDelete();
}}
>
탈퇴
Expand Down
Loading