Add articlehistory on updateBySku and getHistoryBySku

This commit is contained in:
seb
2026-08-05 09:17:17 +02:00
parent 530efa4f09
commit 46c85fe29e
6 changed files with 112 additions and 4 deletions

View File

@@ -183,6 +183,11 @@ const MENU = {
label: 'getBySku',
hint: 'googleAuthId, sku → row',
},
{
value: 'article.getHistoryBySku',
label: 'getHistoryBySku',
hint: 'googleAuthId, sku → history[]',
},
{
value: 'article.updateBySku',
label: 'updateBySku',
@@ -779,6 +784,18 @@ async function runMethod(client, action) {
await client.article.getBySku(Number(googleAuthId), sku),
];
}
case 'article.getHistoryBySku': {
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;
return [
'result',
await client.article.getHistoryBySku(Number(googleAuthId), sku),
];
}
case 'article.updateBySku': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;