fix: add finally function after failed send email
This commit is contained in:
parent
03d91f3fa0
commit
8f365f998e
@ -6,7 +6,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
import { useCommCode } from '@/hooks/useCommCode'
|
import { useCommCode } from '@/hooks/useCommCode'
|
||||||
import { CommCode } from '@/types/CommCode'
|
import { CommCode } from '@/types/CommCode'
|
||||||
// import { sendEmail } from '@/libs/mailer'
|
import { sendEmail } from '@/libs/mailer'
|
||||||
import { useSpinnerStore } from '@/store/spinnerStore'
|
import { useSpinnerStore } from '@/store/spinnerStore'
|
||||||
|
|
||||||
interface SubmitFormData {
|
interface SubmitFormData {
|
||||||
@ -91,20 +91,23 @@ export default function SurveySaleSubmitPopup() {
|
|||||||
window.neoConfirm('送信しますか? 送信後は変更・修正することはできません。', () => {
|
window.neoConfirm('送信しますか? 送信後は変更・修正することはできません。', () => {
|
||||||
setIsShow(true)
|
setIsShow(true)
|
||||||
submitSurvey({ targetId: submitData.store })
|
submitSurvey({ targetId: submitData.store })
|
||||||
// sendEmail({
|
sendEmail({
|
||||||
// to: submitData.receiver,
|
to: submitData.receiver,
|
||||||
// subject: submitData.title,
|
subject: submitData.title,
|
||||||
// content: submitData.contents,
|
content: submitData.contents,
|
||||||
// })
|
})
|
||||||
// .then(() => {
|
.then(() => {
|
||||||
if (!isSubmittingSurvey) {
|
if (!isSubmittingSurvey) {
|
||||||
popupController.setSurveySaleSubmitPopup(false)
|
popupController.setSurveySaleSubmitPopup(false)
|
||||||
}
|
}
|
||||||
// })
|
})
|
||||||
// .catch((error) => {
|
.catch((error) => {
|
||||||
// console.error('Error sending email:', error)
|
console.error('Error sending email:', error)
|
||||||
// alert('メール送信に失敗しました。')
|
alert('メール送信に失敗しました。')
|
||||||
// })
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setIsShow(false)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user