docs: add JSDoc headers to all externally exported store functions
This commit is contained in:
@@ -6,6 +6,18 @@ function parseJsonArray(raw) {
|
||||
return Array.isArray(arr) ? arr : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the full detail of an article by its SKU, including unit, brand,
|
||||
* categories, photos, EANs and prices.
|
||||
*
|
||||
* @param {object} pool - The mssql connection pool.
|
||||
* @returns {Function} An async function that fetches an article by SKU.
|
||||
*
|
||||
* @example
|
||||
* const fn = getBySku(pool);
|
||||
* const article = await fn(42, 'SKU-1');
|
||||
* // => { article: { id, sku, name, unit, brand, categoryIds, photos, eans, prices, ... } }
|
||||
*/
|
||||
export default function getBySku(pool) {
|
||||
return async (googleAuthId, sku) => {
|
||||
const t0 = performance.now();
|
||||
|
||||
Reference in New Issue
Block a user