fix: cannot disable user

This commit is contained in:
Methapon2001 2024-07-01 08:50:46 +07:00
parent d08e4fe6d3
commit 5d6b61b46f

View file

@ -75,7 +75,7 @@ export async function createUser(username: string, password: string, opts?: Reco
},
method: "POST",
body: JSON.stringify({
enabled: true,
enabled: opts?.enabled !== undefined ? opts.enabled : true,
credentials: [{ type: "password", value: password }],
username,
...opts,
@ -110,7 +110,7 @@ export async function editUser(userId: string, opts: Record<string, any>) {
},
method: "PUT",
body: JSON.stringify({
enabled: true,
enabled: opts?.enabled !== undefined ? opts.enabled : true,
credentials: (password && [{ type: "password", value: opts?.password }]) || undefined,
...rest,
}),