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