Question · Vibe coding with Claude Code course · Module 14: Pinterest clone

Quiz: data: body in a POST route

The POST /api/pins route calls prisma.pin.create({ data: body }) with the request body. What can a client do?

Answer options

  • Nothing bad: Prisma itself rejects fields that were not in the form
  • Only send a title that is too long, because TypeScript types check the rest at run time
  • Set any column, for example the ownerId of someone else's account, so the pin lands on the captain's account
  • Nothing, as long as the route answers with a 201

You can check the correct answer by solving this task in the CodeWorlds game.