This commit is contained in:
seb
2026-07-31 16:06:51 +02:00
parent 38f90ceec1
commit f9dec6d51a
11 changed files with 200 additions and 0 deletions

View File

@@ -101,6 +101,16 @@ const MENU = {
{ value: 'category.getCategoryArticles', label: 'getCategoryArticles', hint: 'googleAuthId, categoryId → rows' },
],
},
article: {
label: 'article',
items: [
{
value: 'article.createUnderParent',
label: 'createUnderParent',
hint: 'googleAuthId, parentId, name → row',
},
],
},
companyuser: {
label: 'companyuser',
items: [
@@ -354,6 +364,24 @@ async function runMethod(client, action) {
),
];
}
case 'article.createUnderParent': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;
const parentId = await askInt('category id');
if (parentId == null) return;
const name = await askText('name', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (name == null) return;
return [
'result',
await client.article.createUnderParent({
googleAuthId: Number(googleAuthId),
parentId: Number(parentId),
name,
}),
];
}
case 'companyuser.add': {
const companyId = await askInt('Company id');
if (companyId == null) return;