diff --git a/src/store/article/setCategoryIdsBySku.js b/src/store/article/setCategoryIdsBySku.js index 683b76d..f2bb8de 100644 --- a/src/store/article/setCategoryIdsBySku.js +++ b/src/store/article/setCategoryIdsBySku.js @@ -25,6 +25,9 @@ export default function setCategoryIdsBySku(pool) { seen.add(categoryId); normalized.push(categoryId); } + if (normalized.length === 0) { + throw new Error('Article must have at least one category'); + } const { articleId, languageId, companyId } = await resolve( googleAuthId,