mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
fix(api): 🏷️ Use context.body for 204 responses
This commit is contained in:
parent
6af6bde12a
commit
a7b29d563e
8 changed files with 17 additions and 13 deletions
|
|
@ -146,7 +146,7 @@ export default apiRoute((app) => {
|
|||
|
||||
await role.linkUser(targetUser.id);
|
||||
|
||||
return context.text("", 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
|
||||
app.openapi(routeDelete, async (context) => {
|
||||
|
|
@ -186,6 +186,6 @@ export default apiRoute((app) => {
|
|||
|
||||
await role.unlinkUser(targetUser.id);
|
||||
|
||||
return context.text("", 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -362,6 +362,6 @@ export default apiRoute((app) => {
|
|||
|
||||
await db.delete(Emojis).where(eq(Emojis.id, id));
|
||||
|
||||
return context.text("", 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const routePut = createRoute({
|
|||
},
|
||||
},
|
||||
responses: {
|
||||
204: {
|
||||
200: {
|
||||
description: "Media updated",
|
||||
content: {
|
||||
"application/json": {
|
||||
|
|
@ -147,10 +147,10 @@ export default apiRoute((app) => {
|
|||
thumbnailUrl,
|
||||
});
|
||||
|
||||
return context.json(attachment.toApi(), 204);
|
||||
return context.json(attachment.toApi(), 200);
|
||||
}
|
||||
|
||||
return context.json(attachment.toApi(), 204);
|
||||
return context.json(attachment.toApi(), 200);
|
||||
});
|
||||
|
||||
app.openapi(routeGet, async (context) => {
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ export default apiRoute((app) => {
|
|||
visible,
|
||||
});
|
||||
|
||||
return context.text("", 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
|
||||
app.openapi(routeDelete, async (context) => {
|
||||
|
|
@ -261,6 +261,6 @@ export default apiRoute((app) => {
|
|||
|
||||
await role.delete();
|
||||
|
||||
return context.text("", 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -343,6 +343,6 @@ export default apiRoute((app) => {
|
|||
.delete(Filters)
|
||||
.where(and(eq(Filters.userId, user.id), eq(Filters.id, id)));
|
||||
|
||||
return context.text("", 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue