mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
fix(api): 🐛 Deleting emojis now removes them from object storage
This commit is contained in:
parent
7846a03bcf
commit
29d7b09677
5 changed files with 119 additions and 11 deletions
|
|
@ -104,6 +104,13 @@ export default (app: Hono) =>
|
|||
|
||||
switch (context.req.method) {
|
||||
case "DELETE": {
|
||||
const mediaBackend = await MediaBackend.fromBackendType(
|
||||
config.media.backend,
|
||||
config,
|
||||
);
|
||||
|
||||
await mediaBackend.deleteFileByUrl(emoji.url);
|
||||
|
||||
await db.delete(Emojis).where(eq(Emojis.id, id));
|
||||
|
||||
return response(null, 204);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue