Skip to content

Commit

Permalink
fix: Reset all fields when Reset button is clicked on Add Asset Drawer (
Browse files Browse the repository at this point in the history
  • Loading branch information
getwithashish authored Jul 26, 2024
1 parent e6e936e commit 2de9913
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions exam_frontend/src/components/AddAsset/AddAsset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ const AddAsset: React.FC = ({
setProcessorGen("");
setMemory("");
setStorage("");

setTimeout(() => {
setResetForm(false);
}, 100);
Expand Down Expand Up @@ -423,9 +422,7 @@ const AddAsset: React.FC = ({
}
} catch (error) {
console.error("Error fetching asset type or asset creation :", error);
message.error(
error.data?.message
);
message.error(error.data?.message);
return;
} finally {
setLoading(false);
Expand Down Expand Up @@ -954,7 +951,10 @@ const AddAsset: React.FC = ({
width: "120px",
height: "40px",
}}
onClick={() => handleResetForm()}
onClick={() => {
handleResetForm();
setAssetCategoryValue("");
}}
>
Reset
</Button>
Expand Down

0 comments on commit 2de9913

Please sign in to comment.