From 9df72b996e842b9878acabc079cf74fbefee3a06 Mon Sep 17 00:00:00 2001 From: "MSI\\2Fi" Date: Thu, 7 Aug 2025 17:14:38 +0800 Subject: [PATCH] Update test email function --- src/app/api/mail/actions.ts | 10 +++++++++- src/components/MailSetting/MailSetting.tsx | 8 +++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/api/mail/actions.ts b/src/app/api/mail/actions.ts index b4ac628..0865793 100644 --- a/src/app/api/mail/actions.ts +++ b/src/app/api/mail/actions.ts @@ -39,4 +39,12 @@ export const test15th = async () => { // body: JSON.stringify(data), headers: { "Content-Type": "application/json" }, }); -}; \ No newline at end of file +}; + +export const testEmail = async () => { + return serverFetchWithNoContent(`${BASE_API_URL}/mails/test-email`, { + method: "GET", + // body: JSON.stringify(data), + headers: { "Content-Type": "application/json" }, + }); +}; diff --git a/src/components/MailSetting/MailSetting.tsx b/src/components/MailSetting/MailSetting.tsx index 6e19c59..d6a80e1 100644 --- a/src/components/MailSetting/MailSetting.tsx +++ b/src/components/MailSetting/MailSetting.tsx @@ -17,7 +17,7 @@ import { import { Tab, Tabs, TabsProps, Typography } from "@mui/material"; import TimesheetMailDetails from "./TimesheetMailDetails"; import { Error } from "@mui/icons-material"; -import { MailSave, saveMail, testEveryone, test7th, test15th } from "@/app/api/mail/actions"; +import { MailSave, saveMail, testEveryone, test7th, test15th, testEmail } from "@/app/api/mail/actions"; import SettingDetails from "./SettingDetails"; import { errorDialog, submitDialog, successDialog } from "../Swal/CustomAlerts"; @@ -95,10 +95,12 @@ const MailSetting: React.FC = ({ try { // msg = "testEveryone" // await testEveryone() - msg = "test7th" - await test7th() + // msg = "test7th" + // await test7th() // msg = "test15th" // await test15th() + msg = "testEmail" + await testEmail() } catch (error) { console.log(error) console.log(msg)