Commit c7602a65 authored by Joel's avatar Joel

fix: filter invalid payload

parent 05769950
......@@ -125,7 +125,8 @@ const TextGeneration: FC<IMainProps> = ({
notify({ type: 'error', message: t('share.generation.errorMsg.fileStructNotMatch') })
return false
}
let payloadData = data.slice(0)
let payloadData = data.slice(1)
if (payloadData.length === 0) {
notify({ type: 'error', message: t('share.generation.errorMsg.atLeastOne') })
return false
......@@ -202,7 +203,7 @@ const TextGeneration: FC<IMainProps> = ({
return
}
const payloadData = data.slice(0)
const payloadData = data.filter(item => !item.every(i => i === '')).slice(1)
setIsCallBatchAPI(true)
const allTaskList: Task[] = payloadData.map((item, i) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment