payload
Version:
Node, React, Headless CMS and Application Framework built on Next.js
20 lines (19 loc) • 452 B
JavaScript
export const docWithFilenameExists = async ({ collectionSlug, filename, prefix, req })=>{
const where = {
filename: {
equals: filename
}
};
if (prefix) {
where.prefix = {
equals: prefix
};
}
const doc = await req.payload.db.findOne({
collection: collectionSlug,
req,
where
});
return !!doc;
};
//# sourceMappingURL=docWithFilenameExists.js.map