From 95e37172a6f511b7b8740983281058b465b7d58d Mon Sep 17 00:00:00 2001 From: Myxogastria0808 Date: Sun, 25 Jan 2026 14:37:38 +0900 Subject: [PATCH] hotfix: remove webhook URL --- .../components/ReminderTest/ReminderTest.tsx | 39 ++++++++++--------- products/notify/src/index.ts | 28 ++++++------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/products/frontend/src/routes/Root/components/ReminderTest/ReminderTest.tsx b/products/frontend/src/routes/Root/components/ReminderTest/ReminderTest.tsx index 50182cd..61e12ac 100644 --- a/products/frontend/src/routes/Root/components/ReminderTest/ReminderTest.tsx +++ b/products/frontend/src/routes/Root/components/ReminderTest/ReminderTest.tsx @@ -1,34 +1,35 @@ -import type { FC } from "react"; +import type { FC } from 'react'; type Props = { - historyData: { - id: number; - from: string; - to: string; - amount: number; - }[] | undefined -} + historyData: + | { + id: number; + from: string; + to: string; + amount: number; + }[] + | undefined; +}; const ReminderTest: FC = (props) => { - const discordWebhookUrl = "https://discord.com/api/webhooks/1430405385671671858/EZZlF3vrhVw-zwhBg9OVVuINsOJHSc-NneYRfVKzR-V32Ng76lYLcByOnVKCkNuVrIfG"; + const discordWebhookUrl = ''; const onClick = () => { - if (confirm("Discordにリマインダが送信されます。よろしいですか?")) { - const message = props.historyData === undefined - ? "No data" - : props.historyData.map((v) => `返金の流れ: ${v.to} -> ${v.from}\n\t金額: ${v.amount}\n`).join("\n"); + if (confirm('Discordにリマインダが送信されます。よろしいですか?')) { + const message = + props.historyData === undefined + ? 'No data' + : props.historyData.map((v) => `返金の流れ: ${v.to} -> ${v.from}\n\t金額: ${v.amount}\n`).join('\n'); fetch(discordWebhookUrl, { - method: "POST", - headers: { "Content-Type": "application/json" }, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ content: `==========\n@gangbujun_25033 \n現在残っている返金\n${message}` }), }); } }; - return( - - ) + return ; }; -export default ReminderTest; \ No newline at end of file +export default ReminderTest; diff --git a/products/notify/src/index.ts b/products/notify/src/index.ts index 70d2ea2..1a6e62e 100644 --- a/products/notify/src/index.ts +++ b/products/notify/src/index.ts @@ -19,8 +19,7 @@ export interface Env { export default { async scheduled(controller: ScheduledController, env: Env, ctx: ExecutionContext) { - const webhookUrl = - 'https://discord.com/api/webhooks/1441344649863364608/vzOVqSEeNtjavKfq9MJaNoCB402dd_2W6J3BBr2nHFRngXEPaUm3r0IsvSs41ZIrSahz'; + const webhookUrl = ''; // DBのデータを取得 const data: string = await reminder(env.API_URL); @@ -31,17 +30,20 @@ export default { body: JSON.stringify({ content: data }), }); - const webhookUrlTest = 'https://discord.com/api/webhooks/1442164725273071649/SVu-eSyDZJ2pwXHOUFALlm0D8GtoeWS1oZzmJJan-H65Y9p3I3_Zmd4ysZL7vBo4vU-p'; - - const historyData = [{ - to: "そぽたん", - from: "れん", - amount: 1000 - }, { - to: "そぽたん", - from: "ひろと", - amount: 2000 - }]; + const webhookUrlTest = ''; + + const historyData = [ + { + to: 'そぽたん', + from: 'れん', + amount: 1000, + }, + { + to: 'そぽたん', + from: 'ひろと', + amount: 2000, + }, + ]; const message = historyData.map((v) => `返金の流れ: ${v.to} -> ${v.from}\n\t金額: ${v.amount}\n`).join('\n');