u
This commit is contained in:
@@ -2,7 +2,6 @@ import {
|
||||
LIST_BY_COMPANY as MSSQL_LIST_BY_COMPANY,
|
||||
LIST_BY_COMPANY_AND_GROUP as MSSQL_LIST_BY_COMPANY_AND_GROUP,
|
||||
LIST_CUSTOMERS_BY_COMPANY as MSSQL_LIST_CUSTOMERS_BY_COMPANY,
|
||||
POS_GROUP_NAME,
|
||||
SUPPLIER_GROUP_NAME,
|
||||
} from '../../providers/mssql/queries/entity.js';
|
||||
import {
|
||||
@@ -58,7 +57,6 @@ export default function list(provider) {
|
||||
const result = await runner.query(listCustomersSql, {
|
||||
companyId,
|
||||
supplierGroupName: SUPPLIER_GROUP_NAME,
|
||||
posGroupName: POS_GROUP_NAME,
|
||||
});
|
||||
return result.rows.map(shape);
|
||||
}
|
||||
|
||||
@@ -8,12 +8,10 @@ import {
|
||||
} from '../../providers/sqlite3/queries/manifestDoc.js';
|
||||
import {
|
||||
GET_CUSTOMER_BY_ID as MSSQL_GET_CUSTOMER_BY_ID,
|
||||
POS_GROUP_NAME as MSSQL_POS_GROUP_NAME,
|
||||
SUPPLIER_GROUP_NAME as MSSQL_SUPPLIER_GROUP_NAME,
|
||||
} from '../../providers/mssql/queries/entity.js';
|
||||
import {
|
||||
GET_CUSTOMER_BY_ID as SQLITE_GET_CUSTOMER_BY_ID,
|
||||
POS_GROUP_NAME as SQLITE_POS_GROUP_NAME,
|
||||
SUPPLIER_GROUP_NAME as SQLITE_SUPPLIER_GROUP_NAME,
|
||||
} from '../../providers/sqlite3/queries/entity.js';
|
||||
import makeRunner from '../runner.js';
|
||||
@@ -56,13 +54,11 @@ export async function assertCustomerEntity(runnerOrPool, txOrCompanyId, maybeCom
|
||||
const isSqlite = runner?.dialect === 'sqlite3';
|
||||
const getCustomerSql = isSqlite ? SQLITE_GET_CUSTOMER_BY_ID : MSSQL_GET_CUSTOMER_BY_ID;
|
||||
const supplierGroupName = isSqlite ? SQLITE_SUPPLIER_GROUP_NAME : MSSQL_SUPPLIER_GROUP_NAME;
|
||||
const posGroupName = isSqlite ? SQLITE_POS_GROUP_NAME : MSSQL_POS_GROUP_NAME;
|
||||
|
||||
const result = await runner.query(getCustomerSql, {
|
||||
id: entityId,
|
||||
companyId,
|
||||
supplierGroupName,
|
||||
posGroupName,
|
||||
});
|
||||
|
||||
if (!result.rows[0]) {
|
||||
|
||||
Reference in New Issue
Block a user