Commit eb5a2526 by archer

fix: csv select

parent a19c8b91
...@@ -48,7 +48,9 @@ const CsvImport = ({ kbId }: { kbId: string }) => { ...@@ -48,7 +48,9 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
setSelecting(true); setSelecting(true);
try { try {
let promise = Promise.resolve(); let promise = Promise.resolve();
files.forEach((file) => { files
.filter((file) => /csv$/.test(file.name))
.forEach((file) => {
promise = promise.then(async () => { promise = promise.then(async () => {
const { header, data } = await readCsvContent(file); const { header, data } = await readCsvContent(file);
if (header[0] !== 'question' || header[1] !== 'answer') { if (header[0] !== 'question' || header[1] !== 'answer') {
......
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 sign in to comment