Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/pages/BulkMessagePage/BulkMessagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import PageHeader from "@components/PageHeader/PageHeader";
import apiClient from "@apis/apiClient";
import { SelectChangeEvent } from "@mui/material";
import useUserStore from "@stores/useUserStore";
import { showToast } from "@components/Toast/Toast";

interface Customer {
uid: number;
Expand Down Expand Up @@ -626,7 +627,9 @@ const BulkMessagePage = () => {
"{{생년월일}}": customer.birthday
? formatBirthday(customer.birthday)
: "생일 정보 없음",
"{{관심지역}}": customer.legalDistrictCode || "관심지역 정보 없음",
"{{관심지역}}": customer.legalDistrictCode
? `$$###{${customer.legalDistrictCode}}`
: "",
};

return content.replace(/{{[^}]+}}/g, (match) => {
Expand Down Expand Up @@ -699,19 +702,17 @@ const BulkMessagePage = () => {

try {
await apiClient.post("/messages", payload);
setToast({
open: true,
message: "문자 발송이 완료되었습니다.",
severity: "success",
showToast({
message: "문자를 발송했습니다.",
type: "success",
});
setCustomers([]);
setSelectedTemplate("");
setMessageContent("");
} catch {
setToast({
open: true,
showToast({
message: "문자 발송에 실패했습니다.",
severity: "error",
type: "error",
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function CustomerBulkUploadModal({
handleClose();
fetchCustomerData();
} catch (error) {
console.log(error);
const axiosError = error as AxiosError<ErrorResponse>;
const errorMessage =
axiosError.response?.data?.message ||
Expand Down