This commit is contained in:
seb
2026-08-01 03:37:45 +02:00
parent 69a24192d3
commit 1756dc7ef0
10 changed files with 179 additions and 13 deletions

View File

@@ -135,6 +135,11 @@ const MENU = {
label: 'orderImages',
hint: 'googleAuthId, sku, comma fullHashes',
},
{
value: 'article.delete',
label: 'delete',
hint: 'googleAuthId, sku',
},
],
},
pic: {
@@ -508,10 +513,20 @@ async function runMethod(client, action) {
}),
];
}
case 'article.delete': {
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;
await client.article.delete(Number(googleAuthId), sku);
return ['ok', true];
}
case 'pic.getImageByHash': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;
const fullHash = await askText('fullHash (SHA-256 hex)', {
const fullHash = await askText('fullHash', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (fullHash == null) return;
@@ -533,7 +548,7 @@ async function runMethod(client, action) {
case 'pic.getThumbByHash': {
const googleAuthId = await askInt('google_auth id');
if (googleAuthId == null) return;
const fullHash = await askText('fullHash (SHA-256 hex)', {
const fullHash = await askText('fullHash', {
validate: (v) => (!v?.trim() ? 'Required' : undefined),
});
if (fullHash == null) return;