mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
fix(api): 🐛 Correctly return empty body without content-type headers, when returning empty responses
This commit is contained in:
parent
2743528727
commit
06376cf58a
15 changed files with 18 additions and 18 deletions
|
|
@ -146,7 +146,7 @@ export default apiRoute((app) => {
|
|||
|
||||
await role.linkUser(targetUser.id);
|
||||
|
||||
return context.newResponse(null, 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.newResponse(null, 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -337,6 +337,6 @@ export default apiRoute((app) =>
|
|||
email: email ?? "",
|
||||
});
|
||||
|
||||
return context.newResponse(null, 200);
|
||||
return context.body(null, 200);
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -352,6 +352,6 @@ export default apiRoute((app) => {
|
|||
|
||||
await db.delete(Emojis).where(eq(Emojis.id, id));
|
||||
|
||||
return context.newResponse(null, 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,6 +68,6 @@ export default apiRoute((app) =>
|
|||
dismissed: true,
|
||||
});
|
||||
|
||||
return context.newResponse(null, 200);
|
||||
return context.body(null, 200);
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@ export default apiRoute((app) =>
|
|||
|
||||
await user.clearAllNotifications();
|
||||
|
||||
return context.newResponse(null, 200);
|
||||
return context.body(null, 200);
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,6 +60,6 @@ export default apiRoute((app) =>
|
|||
|
||||
await user.clearSomeNotifications(ids);
|
||||
|
||||
return context.newResponse(null, 200);
|
||||
return context.body(null, 200);
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ export default apiRoute((app) => {
|
|||
visible,
|
||||
});
|
||||
|
||||
return context.newResponse(null, 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
|
||||
app.openapi(routeDelete, async (context) => {
|
||||
|
|
@ -261,6 +261,6 @@ export default apiRoute((app) => {
|
|||
|
||||
await role.delete();
|
||||
|
||||
return context.newResponse(null, 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.newResponse(null, 204);
|
||||
return context.body(null, 204);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue