listusers with loginname

This commit is contained in:
peintnermax
2024-09-11 09:27:04 +02:00
parent 9cba5755c3
commit 08a4cbff24
3 changed files with 19 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ export type SendLoginnameCommand = {
export async function sendLoginname(command: SendLoginnameCommand) {
const users = await listUsers({
userName: command.loginName,
loginName: command.loginName,
organizationId: command.organization,
});

View File

@@ -9,7 +9,7 @@ type ResetPasswordCommand = {
export async function resetPassword(command: ResetPasswordCommand) {
const users = await listUsers({
userName: command.loginName,
loginName: command.loginName,
organizationId: command.organization,
});

View File

@@ -258,23 +258,39 @@ export async function getUserByID(userId: string) {
}
export async function listUsers({
loginName,
userName,
email,
organizationId,
}: {
loginName?: string;
userName?: string;
email?: string;
organizationId?: string;
}) {
const queries: SearchQuery[] = [];
if (loginName) {
queries.push(
create(SearchQuerySchema, {
query: {
case: "loginNameQuery",
value: {
loginName: loginName,
method: TextQueryMethod.EQUALS,
},
},
}),
);
}
if (userName) {
queries.push(
create(SearchQuerySchema, {
query: {
case: "userNameQuery",
value: {
userName,
userName: userName,
method: TextQueryMethod.EQUALS,
},
},