mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
feat(server): add public user type (#10006)
This commit is contained in:
@@ -59,6 +59,13 @@ export class UserModel extends BaseModel {
|
||||
});
|
||||
}
|
||||
|
||||
async getPublicUsers(ids: string[]): Promise<PublicUser[]> {
|
||||
return this.db.user.findMany({
|
||||
select: publicUserSelect,
|
||||
where: { id: { in: ids } },
|
||||
});
|
||||
}
|
||||
|
||||
async getUserByEmail(email: string): Promise<User | null> {
|
||||
const rows = await this.db.$queryRaw<User[]>`
|
||||
SELECT id, name, email, password, registered, email_verified as emailVerifiedAt, avatar_url as avatarUrl, registered, created_at as createdAt
|
||||
|
||||
Reference in New Issue
Block a user