Files
klz-cables.com/.pnpm-store/v10/files/5b/ca1e5eb05e2240ebcbcaae2c7f4d65f30cd0c6973a0ac71e51a9ae1aafc184031406d27c78064fcceefce4b87372297cc675807bd25843ac5551ecb3e2c5e5
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

27 lines
882 B
Plaintext

import toSnakeCase from 'to-snake-case';
import { upsertRow } from './upsertRow/index.js';
import { getTransaction } from './utilities/getTransaction.js';
export const create = async function create({ collection: collectionSlug, customID, data, req, returning, select }) {
const collection = this.payload.collections[collectionSlug].config;
const tableName = this.tableNameMap.get(toSnakeCase(collection.slug));
const db = await getTransaction(this, req);
const result = await upsertRow({
adapter: this,
collectionSlug,
customID,
data,
db,
fields: collection.flattenedFields,
ignoreResult: returning === false,
operation: 'create',
req,
select,
tableName
});
if (returning === false) {
return null;
}
return result;
};
//# sourceMappingURL=create.js.map