From eaf4df4f5a4bad9e765ae5f7637c309e40350ab8 Mon Sep 17 00:00:00 2001 From: seb Date: Mon, 3 Aug 2026 08:51:20 +0200 Subject: [PATCH] Require at least one category when setting article categories Prevents articles from becoming unreachable by rejecting empty categoryIds arrays in setCategoryIdsBySku. --- src/store/article/setCategoryIdsBySku.js | 3 +++ 1 file changed, 3 insertions(+) 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,