fix: properly clean up product uploads

This commit is contained in:
trisua 2025-08-10 00:19:57 -04:00
parent 7a31dcbd9b
commit 5a9160f612

View file

@ -250,6 +250,15 @@ If your product is a purchase of goods or services, please be sure to fulfill th
return Err(Error::NotAllowed); return Err(Error::NotAllowed);
} }
// remove uploads
for upload in product.uploads.thumbnails {
self.delete_upload(upload).await?;
}
if product.uploads.reward != 0 {
self.delete_upload(product.uploads.reward).await?;
}
// ... // ...
let conn = match self.0.connect().await { let conn = match self.0.connect().await {
Ok(c) => c, Ok(c) => c,