tatorte only available via token

This commit is contained in:
2025-06-23 14:46:09 +02:00
parent 5be47343c4
commit bb98c3656e
10 changed files with 48 additions and 67 deletions

View File

@@ -1,7 +1,7 @@
import { client } from '$lib/minio';
import { BUCKET, client } from '$lib/minio';
export async function GET() {
const stream = client.listObjectsV2('tatort', '', true);
const stream = client.listObjectsV2(BUCKET, '', true);
const result = new ReadableStream({
start(controller) {
stream.on('data', (data) => {
@@ -22,3 +22,14 @@ export async function GET() {
}
});
}
export async function DELETE({ request }: { request: Request }) {
const url_fragments = request.url.split('/');
const item = url_fragments.at(-1);
const vorgang = url_fragments.at(-2);
await client.removeObject(BUCKET, `${vorgang}/${item}`);
return new Response(null, { status: 204 });
}