When designing API routes, make the HTTP method and response contract match the operation’s intent and the client’s needs.
204 No Content.user) or a minimal, explicit summary of what changed (e.g., which items were removed).Example pattern:
fastify.delete('/account/reset-module', {
schema: schemas.resetModule
}, async (req, reply) => {
// ...remove/reset items
return reply.code(204);
});
// OR if the client needs a summary:
return {
blockId,
completedChallengesRemoved,
savedChallengesRemoved,
partiallyCompletedChallengesRemoved
};
Enter the URL of a public GitHub repository