u
This commit is contained in:
@@ -97,6 +97,8 @@ const MENU = {
|
||||
label: 'google_auth',
|
||||
items: [
|
||||
{ value: 'google_auth.add', label: 'add', hint: 'email → authId' },
|
||||
{ value: 'google_auth.getById', label: 'getById', hint: 'id → row' },
|
||||
{ value: 'google_auth.getByEmail', label: 'getByEmail', hint: 'email → row' },
|
||||
{ value: 'google_auth.list', label: 'list', hint: '→ rows' },
|
||||
{ value: 'google_auth.del', label: 'del', hint: 'id' },
|
||||
],
|
||||
@@ -311,6 +313,19 @@ async function runMethod(client, action) {
|
||||
if (email == null) return;
|
||||
return ['authId', await client.google_auth.add(email)];
|
||||
}
|
||||
case 'google_auth.getById': {
|
||||
const id = await askInt('Auth id');
|
||||
if (id == null) return;
|
||||
return ['row', await client.google_auth.getById(Number(id))];
|
||||
}
|
||||
case 'google_auth.getByEmail': {
|
||||
const email = await askText('Email', {
|
||||
placeholder: 'user@example.com',
|
||||
validate: (v) => (!v?.trim() ? 'Required' : undefined),
|
||||
});
|
||||
if (email == null) return;
|
||||
return ['row', await client.google_auth.getByEmail(email)];
|
||||
}
|
||||
case 'google_auth.list': {
|
||||
return ['rows', await client.google_auth.list()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user