This commit is contained in:
seb
2026-10-27 06:48:35 +00:00
parent bab5c151d0
commit ccb81cdb26
84 changed files with 5072 additions and 3625 deletions

View File

@@ -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;
};