fixed tatort api route for deletion
Some checks failed
InnoHub Processor/tatort/pipeline/pr-development There was a failure building this commit

This commit is contained in:
2025-06-30 08:35:20 +02:00
parent de7b27bd71
commit fe9f8add88
4 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
import { BUCKET, client } from '$lib/minio';
export async function GET() {
const stream = client.listObjectsV2(BUCKET, '', true);
const result = new ReadableStream({
start(controller) {
stream.on('data', (data) => {
controller.enqueue(`${JSON.stringify(data)}\n`);
});
stream.on('end', () => {
controller.close();
});
},
cancel() {
stream.destroy();
}
});
return new Response(result, {
headers: {
'content-type': 'text/event-stream'
}
});
}
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 });
}