SkyeYoung commented on code in PR #2480: URL: https://github.com/apache/apisix-dashboard/pull/2480#discussion_r905749966
########## web/src/pages/Route/components/DataLoader/Import.tsx: ########## @@ -103,18 +103,20 @@ const DataLoaderImport: React.FC<Props> = (props) => { }); formData.append('file', uploadFileList[0]); - importRoutes(formData).then((r) => { - let errorNumber = 0; - entityNames.forEach((v) => { - errorNumber += r.data[v].failed; - }); + importRoutes(formData) + .then((r) => { + let errorNumber = 0; + entityNames.forEach((v) => { + errorNumber += r.data[v].failed; + }); - setImportResult({ - success: errorNumber <= 0, - data: r.data, - }); - setState('result'); - }); + setImportResult({ + success: errorNumber <= 0, + data: r.data, + }); + setState('result'); + }) + .catch(console.error); Review Comment: Maybe we can try https://stackoverflow.com/a/41041580 (Not Now) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org