No response returning from api route
I'm making an api route to fetch/create a chatId for a chat room but its not returning any response, what is wrong here?
2 Replies
It is tough to debug this just by looking at your code. If you write console logs at each step and see what values are going in and coming out, that is probably the best way to see what is going on.
It is weird that you are not getting any response? Like seriously no response from the API? Are you getting a 200 but no data, or is the API not even returning?
I'm getting 500 response
⨯ Error: No response is returned from route handler 'F:\Projects\Web\ninjask-2\src\app\api\buzz\get-chat-id\route.ts'. Ensure you return a
Response
or a NextResponse
in all branches of your handler.
i fixed it nvm
cannot destructure the first db call it seems