Files
klz-cables.com/.pnpm-store/v10/files/b5/48cbfdb01ea4f5ba4b8e878534ab88e7b3994a52a8145e090a13ead155757a83a56bb2b99999e0e1d39a716559c57fc81b6716939d8d42729d704014c21767
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

22 lines
698 B
Plaintext

import ObjectIdImport from 'bson-objectid';
const ObjectId = 'default' in ObjectIdImport ? ObjectIdImport.default : ObjectIdImport;
export const baseIDField = {
name: 'id',
type: 'text',
admin: {
hidden: true
},
defaultValue: ()=>new ObjectId().toHexString(),
hooks: {
beforeChange: [
({ value })=>value || new ObjectId().toHexString()
],
// ID field values for arrays and blocks need to be unique when duplicating, as on postgres they are stored on the same table as primary keys.
beforeDuplicate: [
()=>new ObjectId().toHexString()
]
},
label: 'ID'
};
//# sourceMappingURL=baseIDField.js.map