feat: product catalog
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Failing after 2m15s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Failing after 2m15s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
This commit is contained in:
24
scripts/debug-product.ts
Normal file
24
scripts/debug-product.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { getPayload } from 'payload';
|
||||
import configPromise from '../payload.config';
|
||||
|
||||
async function debug() {
|
||||
const payload = await getPayload({ config: configPromise });
|
||||
const result = await payload.find({
|
||||
collection: 'products',
|
||||
where: {
|
||||
slug: { equals: 'na2xsy' }
|
||||
},
|
||||
locale: 'de'
|
||||
});
|
||||
|
||||
if (result.docs.length > 0) {
|
||||
const doc = result.docs[0];
|
||||
console.log('Product:', doc.title);
|
||||
console.log('Content Blocks:', JSON.stringify(doc.content?.root?.children?.filter((n: any) => n.type === 'block'), null, 2));
|
||||
} else {
|
||||
console.log('Product not found');
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
debug();
|
||||
Reference in New Issue
Block a user