fix(api): 🐛 Correctly return empty body without content-type headers, when returning empty responses

This commit is contained in:
Jesse Wierzbinski 2024-12-07 12:20:06 +01:00
parent 2743528727
commit 06376cf58a
No known key found for this signature in database
15 changed files with 18 additions and 18 deletions

View file

@ -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);
});
});

View file

@ -337,6 +337,6 @@ export default apiRoute((app) =>
email: email ?? "",
});
return context.newResponse(null, 200);
return context.body(null, 200);
}),
);

View file

@ -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);
});
});

View file

@ -68,6 +68,6 @@ export default apiRoute((app) =>
dismissed: true,
});
return context.newResponse(null, 200);
return context.body(null, 200);
}),
);

View file

@ -47,6 +47,6 @@ export default apiRoute((app) =>
await user.clearAllNotifications();
return context.newResponse(null, 200);
return context.body(null, 200);
}),
);

View file

@ -60,6 +60,6 @@ export default apiRoute((app) =>
await user.clearSomeNotifications(ids);
return context.newResponse(null, 200);
return context.body(null, 200);
}),
);

View file

@ -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);
});
});

View file

@ -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);
});
});