Commit c7602a65 authored by Joel's avatar Joel

fix: filter invalid payload

parent 05769950
...@@ -125,7 +125,8 @@ const TextGeneration: FC<IMainProps> = ({ ...@@ -125,7 +125,8 @@ const TextGeneration: FC<IMainProps> = ({
notify({ type: 'error', message: t('share.generation.errorMsg.fileStructNotMatch') }) notify({ type: 'error', message: t('share.generation.errorMsg.fileStructNotMatch') })
return false return false
} }
let payloadData = data.slice(0)
let payloadData = data.slice(1)
if (payloadData.length === 0) { if (payloadData.length === 0) {
notify({ type: 'error', message: t('share.generation.errorMsg.atLeastOne') }) notify({ type: 'error', message: t('share.generation.errorMsg.atLeastOne') })
return false return false
...@@ -202,7 +203,7 @@ const TextGeneration: FC<IMainProps> = ({ ...@@ -202,7 +203,7 @@ const TextGeneration: FC<IMainProps> = ({
return return
} }
const payloadData = data.slice(0) const payloadData = data.filter(item => !item.every(i => i === '')).slice(1)
setIsCallBatchAPI(true) setIsCallBatchAPI(true)
const allTaskList: Task[] = payloadData.map((item, i) => { 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