This commit is contained in:
seb
2026-07-31 17:50:06 +02:00
parent 7e1e96d3cd
commit c2e128cb55
6 changed files with 116 additions and 3 deletions

View File

@@ -114,6 +114,11 @@ const MENU = {
label: 'getBySku',
hint: 'googleAuthId, sku → row',
},
{
value: 'article.updateBySku',
label: 'updateBySku',
hint: 'googleAuthId, sku, name → row',
},
],
},
companyuser: {
@@ -399,6 +404,22 @@ async function runMethod(client, action) {
await client.article.getBySku(Number(googleAuthId), sku),
];
}
case 'article.updateBySku': {
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 name = await askText('name', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (name == null) return;
return [
'result',
await client.article.updateBySku(Number(googleAuthId), sku, { name }),
];
}
case 'companyuser.add': {
const companyId = await askInt('Company id');
if (companyId == null) return;