Fix bin delete removing source image
Source images are shared entities managed through the Images gallery. Deleting a bin should only remove the processed output (image_filename), not the source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -859,8 +859,8 @@ app.put('/api/bins/:id', (req, res) => {
|
||||
app.delete('/api/bins/:id', (req, res) => {
|
||||
const bin = get_bin(req.params.id);
|
||||
if (!bin) return fail(res, 'not found', 404);
|
||||
// Only delete the processed output — source image is managed independently
|
||||
if (bin.image_filename) remove_image_file(bin.image_filename);
|
||||
remove_image_file(bin.source_id);
|
||||
delete_bin(bin.id);
|
||||
ok(res);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user