Files
klz-cables.com/.pnpm-store/v10/files/38/0ebbb679d7fde7a4a459d40837ad26a9f04740038ffb2aa23b3221d5755df2f9986aadc2a1b2b8584eede6e28a473f905f18f2b1dd929af00e5e8ed5818f48
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

16 lines
820 B
Plaintext

/**
* While the default ID is determined by the db adapter, it can still differ for a collection if they
* define a custom ID field. This builds a map of collection slugs to their ID field type.
* @param defaultIDType as defined by the database adapter
*/ export function getCollectionIDFieldTypes({ config, defaultIDType }) {
return config.collections.reduce((acc, collection)=>{
const customCollectionIdField = collection.fields.find((field)=>'name' in field && field.name === 'id');
acc[collection.slug] = defaultIDType === 'text' ? 'string' : 'number';
if (customCollectionIdField) {
acc[collection.slug] = customCollectionIdField.type === 'number' ? 'number' : 'string';
}
return acc;
}, {});
}
//# sourceMappingURL=getCollectionIDFieldTypes.js.map