x
This commit is contained in:
@@ -12,6 +12,14 @@ import {
|
||||
import {
|
||||
GET_BY_COMPANY_AND_ID as SQLITE_GET_PROP,
|
||||
} from '../../providers/sqlite3/queries/propertyname.js';
|
||||
import {
|
||||
TOUCH_UPDATED_AT as MSSQL_TOUCH,
|
||||
ENQUEUE_SYNC_BY_ARTICLE as MSSQL_ENQUEUE_SYNC,
|
||||
} from '../../providers/mssql/queries/article.js';
|
||||
import {
|
||||
TOUCH_UPDATED_AT as SQLITE_TOUCH,
|
||||
ENQUEUE_SYNC_BY_ARTICLE as SQLITE_ENQUEUE_SYNC,
|
||||
} from '../../providers/sqlite3/queries/article.js';
|
||||
import resolveArticleBySku from '../article/resolveArticleBySku.js';
|
||||
import { recordPropertyChangeHistory } from '../articlehistory/record.js';
|
||||
import makeRunner from '../runner.js';
|
||||
@@ -22,6 +30,8 @@ export default function setByArticleSku(provider) {
|
||||
const deleteSql = isSqlite ? SQLITE_DELETE : MSSQL_DELETE;
|
||||
const insertSql = isSqlite ? SQLITE_INSERT : MSSQL_INSERT;
|
||||
const getPropSql = isSqlite ? SQLITE_GET_PROP : MSSQL_GET_PROP;
|
||||
const touchArticleSql = isSqlite ? SQLITE_TOUCH : MSSQL_TOUCH;
|
||||
const enqueueSyncSql = isSqlite ? SQLITE_ENQUEUE_SYNC : MSSQL_ENQUEUE_SYNC;
|
||||
|
||||
/**
|
||||
* Replaces all properties for an article by its SKU.
|
||||
@@ -124,6 +134,9 @@ export default function setByArticleSku(provider) {
|
||||
newProps: validated,
|
||||
});
|
||||
|
||||
await runner.query(touchArticleSql, { articleId });
|
||||
await runner.query(enqueueSyncSql, { articleId });
|
||||
|
||||
return inserted;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user