This commit is contained in:
seb
2026-08-07 05:21:56 +02:00
parent 70e0a9ddc4
commit 396389457f
22 changed files with 225 additions and 242 deletions

View File

@@ -1,17 +1,15 @@
import { LIST } from '../../sql/language.js';
/**
* Lists all languages.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that lists languages.
*
* @example
* const fn = list(pool);
* const languages = await fn();
* // => [{ id, iso639 }]
*/
export default function list(pool) {
/**
* Lists all languages.
*
* @returns {Promise<Array<{id: number, iso639: string}>>} All language rows.
*
* @example
* const languages = await store.lang.list();
* // => [{ id: 1, iso639: 'de' }]
*/
return async () => {
const result = await pool.request().query(LIST);
return result.recordset;