N
Neon2y ago
wise-white

hey guys im having issues with my code:

hey guys im having issues with my code: using next pages router no ts, my main issue is the api itself i get a 400 error and tried it with postman no go
No description
No description
No description
No description
No description
10 Replies
correct-apricot
correct-apricot2y ago
what do you see if you console.log(data) also, shouldn't the username, email and password be logged? Are then undefined?
stormy-gold
stormy-gold2y ago
{ email: 'usuario@email.com', username: 'For_Science_Greg', password: 'passsword123' }
correct-apricot
correct-apricot2y ago
huh. That's so weird haha what happens when you log !username oh you can also enable type checking for this file without using typescript by adding // @ts-check to the top of a file.
stormy-gold
stormy-gold2y ago
i stopped using prisma and switched to neon/serveless npm package works way better now im only missing one thing and its this:
No description
No description
stormy-gold
stormy-gold2y ago
im trying to verify the password with becrypt for user to be able to login
rare-sapphire
rare-sapphire2y ago
1. Why use a separate query to get the user password? 2. Can you provide the console for the above operation
rare-sapphire
rare-sapphire2y ago
export const GET = async () => {
return NextResponse.json({ message: "Hello world" }, { status: 200 });
};
export const GET = async () => {
return NextResponse.json({ message: "Hello world" }, { status: 200 });
};
No description
rare-sapphire
rare-sapphire2y ago
try directory structure like this and then a code like this. it might help @streethippie466
stormy-gold
stormy-gold2y ago
Il get back to you later @Papa Johns im at work but im also not using ts
rare-sapphire
rare-sapphire2y ago
same goes for ts

Did you find this page helpful?