u
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user