u
This commit is contained in:
@@ -116,11 +116,11 @@ export default function adjust(provider) {
|
||||
const resolvedArticles = [];
|
||||
for (const item of normalizedLines) {
|
||||
const resolved = await resolveArticle(googleAuthId, item.sku, activeTx);
|
||||
const artRes = await runner.query('SELECT is_father, articlelist_id, track_stock FROM article WHERE id = @articleId', {
|
||||
const artRes = await runner.query('SELECT is_parent, articlelist_id, track_stock FROM article WHERE id = @articleId', {
|
||||
articleId: resolved.articleId,
|
||||
});
|
||||
if (artRes.rows[0]?.is_father) {
|
||||
throw new Error(`A father article cannot have stock (${item.sku})`);
|
||||
if (artRes.rows[0]?.is_parent) {
|
||||
throw new Error(`A parent article cannot have stock (${item.sku})`);
|
||||
}
|
||||
|
||||
if (artRes.rows[0]?.articlelist_id != null) {
|
||||
|
||||
Reference in New Issue
Block a user