docs: add JSDoc headers to all externally exported store functions
This commit is contained in:
@@ -7,6 +7,18 @@ import nextSku from '../numbers/nextSku.js';
|
||||
import request from '../request.js';
|
||||
import slugify from '../slugify.js';
|
||||
|
||||
/**
|
||||
* Creates a new article under a given parent category, allocating a SKU and
|
||||
* a default unit.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that creates an article.
|
||||
*
|
||||
* @example
|
||||
* const fn = createUnderParent(pool);
|
||||
* const article = await fn({ googleAuthId: 42, parentId: 5, name: 'Cola' });
|
||||
* // => { id, parentId, name, sku }
|
||||
*/
|
||||
export default function createUnderParent(pool) {
|
||||
const access = resolveCategoryAccess(pool);
|
||||
const ensureUnit = ensureDefaultUnit(pool);
|
||||
|
||||
Reference in New Issue
Block a user