import { ADD } from '../../providers/mssql/queries/companyuser.js'; 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} 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() .input('companyId', companyId) .input('googleAuthId', googleAuthId) .query(ADD); return result.recordset[0].id; }; }