Relative Content

Tag Archive for reactjsnext.js

NextJS Get provided custom response object for 500 error in try/catch

We need to throw a 500 Internal Server Error with a custom object in the response that we will examine in NextJS. On the Spring back-end we return a ResponseEntity<CustomObject> as below. The API call has been verified to work correctly. In Swagger, it outputs both the status and the custom object in the response correctly as expected.

How to force refresh server-side component in nexjs?

I have a orders/page.tsx and orders/[id]/page.tsx. Orders page.tsx is just a server side component which has a table that shows name, phone number, total price, status, edit button of orders. id page.tsx opens single order. It is a client side component. Here you can change the status of the order and after clicking Save button, it sends put request to server and router.push('/orders'). But my orders page table still shows old data (with old status). How can I force my orders/page.tsx to fetch new data after changing status in orders/[id]/page.tsx?