수학에빠진컴싸 [1275747] · MS 2023 (수정됨) · 쪽지

2025-07-27 23:37:01
조회수 24

백업용 덕코 이상하게 보내기.

게시글 주소: https://orbi.kr/00074020366

(async () => {

    const rawId = window.location.pathname.split("/")[1];

    const POST_ID = rawId.substring(3); 

    const DEOKKO_AMOUNT = 1;


    try {

        const response = await fetch(`https://orbi.kr/api/v1/board/post/${POST_ID}/send_xdk`, {

            method: 'POST',

            headers: { 'Content-Type': 'application/json' },

            body: JSON.stringify({ value: DEOKKO_AMOUNT })

        });


        if (!response.ok) {

            const errorData = await response.json();

            throw new Error(errorData.message || "Unknown error");

        }


        const result = await response.json();

        console.log(`덕코 ${DEOKKO_AMOUNT}개 전송 완료 → 게시글 ID: ${POST_ID}`, result);

    } catch (error) {

        console.error("덕코 전송 실패:", error.message);

    }

})();

rare-스키마 rare-스키마

0 XDK (+0)

  1. 유익한 글을 읽었다면 작성자에게 XDK를 선물하세요.