Put in order · Vibe coding with Claude Code course · Module 14: Pinterest clone

Sorting: The checks of the DELETE route

Put in order the steps of the route DELETE /api/boards/[id] from first to last:

Items to put in order

  • Identity from getCurrentUserId()
  • board.ownerId !== viewerId gives 403
  • deleteBoard(id) and a 204 response
  • getBoard(id, viewerId): a missing board or someone else's secret one gives 404

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