|
|
@@ -166,7 +166,14 @@ const updateUserRoute = createRoute({
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- 404: { description: 'User not found' }
|
|
|
+ 404: {
|
|
|
+ description: 'User not found',
|
|
|
+ content: {
|
|
|
+ 'application/json': {
|
|
|
+ schema: ErrorSchema
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -176,7 +183,7 @@ const updateUserHandler = app.openapi(
|
|
|
const { id } = c.req.valid('param');
|
|
|
const data = c.req.valid('json');
|
|
|
const user = await userService.updateUser(parseInt(id), data);
|
|
|
- if (!user) return c.notFound();
|
|
|
+ if (!user) return c.json({ code: 404, message: 'User not found' }, 404);
|
|
|
return c.json(user, 200);
|
|
|
}
|
|
|
);
|
|
|
@@ -193,7 +200,14 @@ const deleteUserRoute = createRoute({
|
|
|
},
|
|
|
responses: {
|
|
|
204: { description: 'No Content' },
|
|
|
- 404: { description: 'User not found' }
|
|
|
+ 404: {
|
|
|
+ description: 'User not found',
|
|
|
+ content: {
|
|
|
+ 'application/json': {
|
|
|
+ schema: ErrorSchema
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|