Require at least one category when setting article categories

Prevents articles from becoming unreachable by rejecting empty
categoryIds arrays in setCategoryIdsBySku.
This commit is contained in:
seb
2026-08-03 08:51:20 +02:00
parent 14d8a4c978
commit eaf4df4f5a

View File

@@ -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,