u
This commit is contained in:
16
src/store/company/getByCompanyUserId.js
Normal file
16
src/store/company/getByCompanyUserId.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import sql from 'mssql';
|
||||
import { GET_BY_COMPANY_USER_ID } from '../../sql/company.js';
|
||||
|
||||
export default function getByCompanyUserId(pool) {
|
||||
return async (companyUserId) => {
|
||||
const result = await pool
|
||||
.request()
|
||||
.input('companyUserId', sql.Int, companyUserId)
|
||||
.query(GET_BY_COMPANY_USER_ID);
|
||||
|
||||
const row = result.recordset[0];
|
||||
if (!row) return null;
|
||||
|
||||
return [row.id, row.default_language_id, row.root_category_id, row.name];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user