parent
a059dbe41b
commit
2d2eefe3d4
6 changed files with 102 additions and 6 deletions
|
@ -39,3 +39,26 @@ export async function lookupUser() {
|
|||
notFound();
|
||||
});
|
||||
}
|
||||
|
||||
export async function lookupUserByEmail() {
|
||||
const { canceled, result } = await os.inputText({
|
||||
title: i18n.ts.emailAddress,
|
||||
type: 'email',
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
try {
|
||||
const user = await os.apiWithDialog('admin/accounts/find-by-email', { email: result });
|
||||
|
||||
os.pageWindow(`/admin/user/${user.id}`);
|
||||
} catch (err) {
|
||||
if (err.code === 'USER_NOT_FOUND') {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: i18n.ts.noSuchUser,
|
||||
});
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue