tatorte only available via token
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user