mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-23 02:17:40 -07:00
tombstone
This commit is contained in:
parent
c8a4e7f3f4
commit
245eb5b59f
3 changed files with 10 additions and 0 deletions
|
@ -29,6 +29,7 @@ export type IMetadata = {
|
|||
folderId: mongo.ObjectID;
|
||||
comment: string;
|
||||
uri: string;
|
||||
deletedAt?: Date;
|
||||
};
|
||||
|
||||
export type IDriveFile = {
|
||||
|
|
BIN
src/server/file/assets/tombstone.png
(Stored with Git LFS)
Normal file
BIN
src/server/file/assets/tombstone.png
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -22,6 +22,12 @@ export default async function(ctx: Koa.Context) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (file.metadata.deletedAt) {
|
||||
ctx.status = 410;
|
||||
await send(ctx, `${__dirname}/assets/tombstone.png`);
|
||||
return;
|
||||
}
|
||||
|
||||
const bucket = await getGridFSBucket();
|
||||
|
||||
const readable = bucket.openDownloadStream(fileId);
|
||||
|
|
Loading…
Reference in a new issue