Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 44 characters in body
Source Link
Jai
  • 74.8k
  • 12
  • 77
  • 104

Because you don't have routes for that as the error states:

app.get('/destroybox/:id' 

You can see you have a route from root / to destroybox then :id etc. While you are having a href of:

 href="/portal/destroybox/<%= box._id %>" 

from root / to portal and then destroybox then the id. Which is no where defined in the config.


Solution is to change the href to:

href="/destroybox/<%= box._id %>" 

same goes for other href attributes too.

Because you don't have routes for that as the error states:

app.get('/destroybox/:id' 

You can see you have a route from root / to destroybox then :id etc. While you are having a href of:

 href="/portal/destroybox/<%= box._id %>" 

from root / to portal and then destroybox then the id. Which is no where defined in the config.


Solution is to change the href to:

href="/destroybox/<%= box._id %>" 

Because you don't have routes for that as the error states:

app.get('/destroybox/:id' 

You can see you have a route from root / to destroybox then :id etc. While you are having a href of:

 href="/portal/destroybox/<%= box._id %>" 

from root / to portal and then destroybox then the id. Which is no where defined in the config.


Solution is to change the href to:

href="/destroybox/<%= box._id %>" 

same goes for other href attributes too.

Post Undeleted by Jai
Post Deleted by Jai
Source Link
Jai
  • 74.8k
  • 12
  • 77
  • 104

Because you don't have routes for that as the error states:

app.get('/destroybox/:id' 

You can see you have a route from root / to destroybox then :id etc. While you are having a href of:

 href="/portal/destroybox/<%= box._id %>" 

from root / to portal and then destroybox then the id. Which is no where defined in the config.


Solution is to change the href to:

href="/destroybox/<%= box._id %>"