🐛 短信消息模板保存

pull/90/head
xiuchen 2024-05-22 16:44:09 +08:00
parent 8352af67b6
commit 541a88ad0c
1 changed files with 5 additions and 5 deletions

View File

@ -345,13 +345,13 @@ export default (props: { visible: boolean }) => {
},
}}
onFinish={async (values) => {
const fieldsValue = editorFormRef.current?.getFieldsValue();
const templates: { type: string; code: string }[] = [];
editableKeys?.forEach((i, index) => {
if (fieldsValue?.[index]?.code !== undefined) {
editableKeys?.forEach((key) => {
const fieldValue = editorFormRef.current?.getFieldValue(key);
if (fieldValue !== undefined) {
const config: { type: string; code: string } = {
type: `${i}`,
code: fieldsValue[index].code,
type: `${key}`,
code: fieldValue?.code,
};
templates.push(config);
}