Skip to content

Commit

Permalink
fix: no longer delete media elemtens
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikZed committed Oct 20, 2024
1 parent 618aedf commit f2ccc9a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions pkg/integration-kencove-api/src/products/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,20 +1326,20 @@ export class KencoveApiAppProductSyncService {
const totalMedia = this.getTotalMediaFromProduct(product);

// Delete all media items, that are not in totalMedia
await this.db.media.deleteMany({
where: {
products: {
some: {
id: schemabaseProductId,
tenantId: this.kencoveApiApp.tenantId,
},
},
tenantId: this.kencoveApiApp.tenantId,
url: {
notIn: totalMedia.map((media) => media.url),
},
},
});
// await this.db.media.deleteMany({
// where: {
// products: {
// some: {
// id: schemabaseProductId,
// tenantId: this.kencoveApiApp.tenantId,
// },
// },
// tenantId: this.kencoveApiApp.tenantId,
// url: {
// notIn: totalMedia.map((media) => media.url),
// },
// },
// });

return this.db.product.update({
where: {
Expand Down

0 comments on commit f2ccc9a

Please sign in to comment.