Skip to content

Commit

Permalink
Merge pull request #682 from openstad/fix/deleting-resource
Browse files Browse the repository at this point in the history
feat: Create delay before redirecting to previous page
  • Loading branch information
iandebruin98 authored Nov 7, 2024
2 parents 5bd3d70 + 6b2211c commit 2efde02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/resource-detail/src/resource-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,16 @@ function ResourceDetail({
try {
if (typeof resource.delete === 'function') {
await resource.delete(resource.id);
window.history.back();
setTimeout(() => {
window.history.back();
}, 1000);
} else {
console.error('Delete method not found on resource');
}
} catch (e) {
console.error(e);
}
}
};

return (
<section>
Expand Down

0 comments on commit 2efde02

Please sign in to comment.