Skip to content

Commit

Permalink
fix: redirect to new page when id does not found
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Jun 18, 2021
1 parent b56ebaa commit 78d4f61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/container/edit-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const EditContainer = () => {
try {
const result = await fetchNote(id)
if (!result) {
router.replace({ query: { new: '1' }, path: router.asPath })
router.replace({ query: { ...router.query, new: 1 } })
return
}
} catch (msg) {
Expand Down

0 comments on commit 78d4f61

Please sign in to comment.