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
1 line
1.4 KiB
Plaintext
1 line
1.4 KiB
Plaintext
{"version":3,"sources":["../../../src/auth/operations/init.ts"],"sourcesContent":["import type { PayloadRequest, Where } from '../../types/index.js'\n\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\n\nexport const initOperation = async (args: {\n collection: string\n req: PayloadRequest\n}): Promise<boolean> => {\n const { collection: slug, req } = args\n\n const collectionConfig = req.payload.config.collections?.find((c) => c.slug === slug)\n\n // Exclude trashed documents unless `trash: true`\n const where: Where = appendNonTrashedFilter({\n enableTrash: Boolean(collectionConfig?.trash),\n trash: false,\n where: {},\n })\n\n const doc = await req.payload.db.findOne({\n collection: slug,\n req,\n where,\n })\n\n return !!doc\n}\n"],"names":["appendNonTrashedFilter","initOperation","args","collection","slug","req","collectionConfig","payload","config","collections","find","c","where","enableTrash","Boolean","trash","doc","db","findOne"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,4CAA2C;AAElF,OAAO,MAAMC,gBAAgB,OAAOC;IAIlC,MAAM,EAAEC,YAAYC,IAAI,EAAEC,GAAG,EAAE,GAAGH;IAElC,MAAMI,mBAAmBD,IAAIE,OAAO,CAACC,MAAM,CAACC,WAAW,EAAEC,KAAK,CAACC,IAAMA,EAAEP,IAAI,KAAKA;IAEhF,iDAAiD;IACjD,MAAMQ,QAAeZ,uBAAuB;QAC1Ca,aAAaC,QAAQR,kBAAkBS;QACvCA,OAAO;QACPH,OAAO,CAAC;IACV;IAEA,MAAMI,MAAM,MAAMX,IAAIE,OAAO,CAACU,EAAE,CAACC,OAAO,CAAC;QACvCf,YAAYC;QACZC;QACAO;IACF;IAEA,OAAO,CAAC,CAACI;AACX,EAAC"} |