Files
klz-cables.com/.pnpm-store/v10/files/53/4e0c5fd0db9b36d985ec5cff234aee3f13332fb2663547bb5dee756c5f0226cdf8f9a3f0ec634737643d24845ad918c992f9ab6dd9a201fd10c4cdeedf5b27
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

17 lines
776 B
Plaintext

// Helper function to extract display value from relationship
export const extractRelationshipDisplayValue = (relationship, clientConfig, relationshipConfig) => {
if (!relationship) {
return '';
}
// Handle polymorphic relationships
if (typeof relationship === 'object' && relationship?.relationTo && relationship?.value) {
const config = clientConfig.collections.find(c => c.slug === relationship.relationTo);
return relationship.value?.[config?.admin?.useAsTitle || 'id'] || '';
}
// Handle regular relationships
if (typeof relationship === 'object' && relationship?.id) {
return relationship[relationshipConfig?.admin?.useAsTitle || 'id'] || '';
}
return String(relationship);
};
//# sourceMappingURL=extractRelationshipDisplayValue.js.map