This commit is contained in:
seb
2026-09-27 21:01:30 +02:00
parent f9c570a036
commit 0cafa11a32
34 changed files with 2010 additions and 1534 deletions

View File

@@ -369,6 +369,11 @@ const MENU = {
label: 'setWeightBySku',
hint: 'googleAuthId, sku, weight → row',
},
{
value: 'article.setTrackStockBySku',
label: 'setTrackStockBySku',
hint: 'googleAuthId, sku, trackStock (true|false) → row',
},
{
value: 'article.setCategoryIdsBySku',
label: 'setCategoryIdsBySku',
@@ -1762,6 +1767,27 @@ async function runMethod(client, action) {
),
];
}
case 'article.setTrackStockBySku': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;
const sku = await askText('sku', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (sku == null) return;
const trackStockRaw = await p.confirm({
message: 'Track stock?',
initialValue: true,
});
if (p.isCancel(trackStockRaw)) return;
return [
'result',
await client.article.setTrackStockBySku(
Number(googleAuthId),
sku,
Boolean(trackStockRaw),
),
];
}
case 'article.setCategoryIdsBySku': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;