diff options
author | Sunil Shetye | 2025-04-04 17:44:18 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-04-07 15:38:16 +0530 |
commit | 62009aa0de19a7f300b586c819653dbec0f8e856 (patch) | |
tree | 78af1fe12f6ccd89e9d99aa7d38e19bb606617b3 | |
parent | ebfe6faf5172cd7caac108db6e89fac02ecfc9aa (diff) | |
download | Common-Interface-Project-62009aa0de19a7f300b586c819653dbec0f8e856.tar.gz Common-Interface-Project-62009aa0de19a7f300b586c819653dbec0f8e856.tar.bz2 Common-Interface-Project-62009aa0de19a7f300b586c819653dbec0f8e856.zip |
add async/await
3 files changed, 9 insertions, 8 deletions
diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js index 2dabaea3..c4f78c03 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SchematicToolbar.js @@ -324,11 +324,12 @@ export default function SchematicToolbar ({ mobileClose, gridRef }) { const formData = new FormData() formData.append('file', xmlBlob, xmlFileName) - const response = await api.post('/simulation/save', formData, { + const config = { headers: { 'Content-Type': 'multipart/form-data' } - }) + } + const response = await api.post('/simulation/save', formData, config) if (!response || response.status !== 200) { throw new Error('Network response was not ok') diff --git a/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js b/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js index 30384440..805c03db 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/SimulationProperties.js @@ -109,7 +109,7 @@ export default function SimulationProperties () { } // Upload the nelist - function netlistConfig (file) { + async function netlistConfig (file) { const formData = new FormData() formData.append('app_name', process.env.REACT_APP_NAME) formData.append('file', file) @@ -118,10 +118,10 @@ export default function SimulationProperties () { } const config = { headers: { - 'content-type': 'multipart/form-data' + 'Content-Type': 'multipart/form-data' } } - return api.post('simulation/upload', formData, config) + return await api.post('simulation/upload', formData, config) } const startSimulate = (type) => { diff --git a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js index a336eade..074f6a0c 100644 --- a/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js +++ b/blocks/eda-frontend/src/components/SchematicEditor/ToolbarExtension.js @@ -368,7 +368,7 @@ export function ScriptScreen ({ isOpen, onClose }) { }) } - function netlistConfig (file, type) { + async function netlistConfig (file, type) { const formData = new FormData() formData.append('app_name', process.env.REACT_APP_NAME) @@ -377,10 +377,10 @@ export function ScriptScreen ({ isOpen, onClose }) { const config = { headers: { - 'content-type': 'multipart/form-data' + 'Content-Type': 'multipart/form-data' } } - return api.post('simulation/upload', formData, config) + return await api.post('simulation/upload', formData, config) } const executeScript = () => { |