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