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,17 @@
import { ADD } from '../../sql/companyuser.js';
/**
* Adds a company user linking a company to a Google auth account.
*
* @param {object} pool - The mssql connection pool.
* @returns {Function} An async function that creates the company user link.
*
* @example
* const fn = add(pool);
* const id = await fn(1, 42);
* // => 7
*/
export default function add(pool) {
/**
* Adds a company user linking a company to a Google auth account.
*
* @param {number} companyId - The id of the company.
* @param {number} googleAuthId - The id of the Google auth account.
* @returns {Promise<number>} The id of the created company user link.
*
* @example
* const id = await store.companyuser.add(1, 42);
* // => 7
*/
return async (companyId, googleAuthId) => {
const result = await pool
.request()