Fix: duplicate toast when saving an example (#6952)

* chore: update saveRequest calls from example to include silent parameter

- Modified multiple components to pass an additional `true` parameter to the `saveRequest` function, ensuring requests are saved silently when it comes to examples.
- Added AGENTS.md to .gitignore to exclude it from version control.

* feat: add success notifications for cloning, renaming and deleting examples

* refactor: update saveRequest calls to handle success notifications for renaming and deleting examples

* refactor: remove unused toast import from DeleteResponseExampleModal
This commit is contained in:
sanish chirayath
2026-01-28 17:59:03 +05:30
committed by GitHub
parent d975d0b642
commit 584344ac47
6 changed files with 14 additions and 8 deletions

1
.gitignore vendored
View File

@@ -55,6 +55,7 @@ bruno.iml
# Development plan files
CLAUDE.md
AGENTS.md
*.plan.md
# packages dist

View File

@@ -93,7 +93,7 @@ const ExampleTab = ({ tab, collection }) => {
onSaveAndClose={() => {
// For examples, we don't have a separate save action
// The changes are saved automatically when the request is saved
dispatch(saveRequest(item.uid, collection.uid));
dispatch(saveRequest(item.uid, collection.uid, true));
dispatch(closeTabs({
tabUids: [tab.uid]
}));

View File

@@ -112,7 +112,7 @@ const ResponseBookmark = forwardRef(({ item, collection, responseSize, children
}));
// Save the request
await dispatch(saveRequest(item.uid, collection.uid));
await dispatch(saveRequest(item.uid, collection.uid, true));
// Task middleware will track this and open the example in a new tab once the file is reloaded
dispatch(insertTaskIntoQueue({

View File

@@ -17,8 +17,10 @@ const DeleteResponseExampleModal = ({ onClose, example, item, collection }) => {
collectionUid: collection.uid,
exampleUid: example.uid
}));
dispatch(saveRequest(item.uid, collection.uid));
onClose();
dispatch(saveRequest(item.uid, collection.uid, true))
.then(() => {
onClose();
});
};
return (

View File

@@ -86,7 +86,7 @@ const ExampleItem = ({ example, item, collection }) => {
}));
// Save the request
await dispatch(saveRequest(item.uid, collection.uid));
await dispatch(saveRequest(item.uid, collection.uid, true));
// Task middleware will track this and open the example in a new tab once the file is reloaded
dispatch(insertTaskIntoQueue({
@@ -125,8 +125,11 @@ const ExampleItem = ({ example, item, collection }) => {
name: newName
}
}));
dispatch(saveRequest(item.uid, collection.uid));
setShowRenameModal(false);
dispatch(saveRequest(item.uid, collection.uid, true))
.then(() => {
toast.success(`Example renamed to "${newName}"`);
setShowRenameModal(false);
});
};
// Build menu items for MenuDropdown

View File

@@ -487,7 +487,7 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
}));
// Save the request
await dispatch(saveRequest(item.uid, collectionUid));
await dispatch(saveRequest(item.uid, collectionUid, true));
// Task middleware will track this and open the example in a new tab once the file is reloaded
dispatch(insertTaskIntoQueue({