Files
klz-cables.com/.pnpm-store/v10/files/9d/53843aca4c8df649f1b98e5180b7d7afbbed219fc99925b2cfd46de1f94725360af6ea2ee0c53884d479c490b2666dac2dce36a6a1c1f91951ad2efb699515
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

35 lines
1.3 KiB
Plaintext

/**
* Mutates the incoming select object to append fields required for upload thumbnails
* @param collectionConfig
* @param select
*/ export const appendUploadSelectFields = ({ collectionConfig, select })=>{
if (!collectionConfig.upload || !select) {
return;
}
select.mimeType = true;
select.thumbnailURL = true;
if (collectionConfig.upload.imageSizes && collectionConfig.upload.imageSizes.length > 0) {
if (collectionConfig.upload.adminThumbnail && typeof collectionConfig.upload.adminThumbnail === 'string') {
/** Only return image size properties that are required to generate the adminThumbnailURL */ select.sizes = {
[collectionConfig.upload.adminThumbnail]: {
filename: true
}
};
} else {
/** Only return image size properties that are required for thumbnails */ select.sizes = collectionConfig.upload.imageSizes.reduce((acc, imageSizeConfig)=>{
return {
...acc,
[imageSizeConfig.name]: {
filename: true,
url: true,
width: true
}
};
}, {});
}
} else {
select.url = true;
}
};
//# sourceMappingURL=appendUploadSelectFields.js.map