@@ -203,7 +203,7 @@ datasetRoutes.post("/:id/upload", jwtMiddleware, async (c) => {
203203 }
204204
205205 // Create the R2 path following the multitenant pattern
206- const r2Path = `${ organizationId } / ${ id } /${ file . name } ` ;
206+ const r2Path = `${ id } /${ file . name } ` ;
207207
208208 // Upload to R2
209209 await c . env . DATASETS . put ( r2Path , await file . arrayBuffer ( ) , {
@@ -243,7 +243,7 @@ datasetRoutes.get("/:id/files", jwtMiddleware, async (c) => {
243243
244244 try {
245245 // List objects in the dataset's directory
246- const prefix = `${ organizationId } / ${ id } /` ;
246+ const prefix = `${ id } /` ;
247247 const files = await c . env . DATASETS . list ( { prefix } ) ;
248248
249249 const response : ListDatasetFilesResponse = {
@@ -277,7 +277,7 @@ datasetRoutes.delete("/:id/files/:filename", jwtMiddleware, async (c) => {
277277 }
278278
279279 try {
280- const r2Path = `${ organizationId } / ${ id } /${ filename } ` ;
280+ const r2Path = `${ id } /${ filename } ` ;
281281 await c . env . DATASETS . delete ( r2Path ) ;
282282
283283 const response : DeleteDatasetFileResponse = {
@@ -308,7 +308,7 @@ datasetRoutes.get("/:id/files/:filename", jwtMiddleware, async (c) => {
308308 }
309309
310310 try {
311- const r2Path = `${ organizationId } / ${ id } /${ filename } ` ;
311+ const r2Path = `${ id } /${ filename } ` ;
312312 const object = await c . env . DATASETS . get ( r2Path ) ;
313313
314314 if ( ! object ) {
0 commit comments