Skip to content

Commit

Permalink
chore: GET 요청 제외 DB 반영 경고 표시 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
a-honey committed Jan 4, 2025
1 parent 81cf962 commit 4776210
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pages/monitoring/ApiTestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ export default function ApiTestForm() {
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();

if (method !== "GET") {
const confirmChange = window.confirm(
"⚠️ 이 요청은 실제 DB에 영향을 줄 수 있습니다. 진행하시겠습니까?"
);
if (!confirmChange) {
console.log("%c요청이 취소되었습니다.", "color: orange;");
return;
}
}

try {
const parsedBody = body ? JSON.parse(body) : undefined;

Expand Down

0 comments on commit 4776210

Please sign in to comment.