mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-27 06:51:36 +03:00
feat: fix users list
This commit is contained in:
parent
fc2a5879bd
commit
932f5f02c4
@ -403,13 +403,13 @@ export class AffineProvider extends BaseProvider {
|
||||
workspace_id: string,
|
||||
email: string
|
||||
): Promise<User | null> {
|
||||
const user = await this._apis.getUserByEmail({ workspace_id, email });
|
||||
return user
|
||||
const users = await this._apis.getUserByEmail({ workspace_id, email });
|
||||
return users?.length
|
||||
? {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
avatar: user.avatar_url,
|
||||
email: user.email,
|
||||
id: users[0].id,
|
||||
name: users[0].name,
|
||||
avatar: users[0].avatar_url,
|
||||
email: users[0].email,
|
||||
}
|
||||
: null;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ export interface User {
|
||||
|
||||
export async function getUserByEmail(
|
||||
params: GetUserByEmailParams
|
||||
): Promise<User | null> {
|
||||
): Promise<User[] | null> {
|
||||
const searchParams = new URLSearchParams({ ...params });
|
||||
return client.get('api/user', { searchParams }).json<User | null>();
|
||||
return client.get('api/user', { searchParams }).json<User[] | null>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user