NeonN
Neon7mo ago
12 replies
broad-salmon

all logs show success but db on neon does not update.

i. am. so. done. with. this.

I have a db which has a table called users, when i login with clerk, it makes a user. after login, the website takes the user to /onboarding where the user has to enter additional information like phone number, postcode and "about me." on submit, the db should be updated with the new details, for the same user, on the same users table. but it is not happening.

I have taken logs from the frontend and the backend with all returning status 200 with all the right details in json format. the db connection is working as well, checked with a simple GET API route and by running pnpm prisma studio. The status 200 logs:
Server: User ID from Clerk session (currentUser): user_2zPQd2ZhtqDzxIU7NU2s45utyRs
Server: User ID from form data (validatedData): {
  firstName: 'Lama',
  lastName: 'Baioi',
  postcode: 'BL1 3BH',
  email: 'mansoor.eb@gmail.com',
  phoneNumber: '0753791889',
  aboutMe: 'FIRST NAME LAST NAME'
}
Server: Attempting to update DB for ID: user_2zPQd2ZhtqDzxIU7NU2s45utyRs
prisma:query SELECT 1
prisma:query UPDATE "public"."User" SET "firstName" = $1, "lastName" = $2, "postcode" = $3, "email" = $4, "phoneNumber" = $5, "aboutMe" = $6, "updatedAt" = $7 WHERE ("public"."User"."id" = $8 AND 1=1) RETURNING "public"."User"."id", "public"."User"."name", "public"."User"."firstName", "public"."User"."lastName", "public"."User"."postcode", "public"."User"."avatar", "public"."User"."email", "public"."User"."phoneNumber", "public"."User"."aboutMe", "public"."User"."createdAt", "public"."User"."updatedAt"
Server: Successfully updated DB user record with ID: user_2zPQd2ZhtqDzxIU7NU2s45utyRs
Server: Clerk publicMetadata updated for user: user_2zPQd2ZhtqDzxIU7NU2s45utyRs
 PUT /api/onboarding 200 in 1074ms
 GET / 200 in 152ms
Was this page helpful?