feat(server): get public user by id (#10434)

close CLOUD-160
This commit is contained in:
fengmk2
2025-03-06 15:25:06 +00:00
parent 7302c4f954
commit 289d3cd20e
13 changed files with 184 additions and 26 deletions
@@ -1,3 +1,4 @@
import { PublicUserType } from '../../core/user';
import { TestingApp } from './testing-app';
export async function currentUser(app: TestingApp) {
@@ -12,6 +13,25 @@ export async function currentUser(app: TestingApp) {
return res.currentUser;
}
export async function getPublicUserById(
app: TestingApp,
id: string
): Promise<PublicUserType | null> {
const res = await app.gql(
`
query getPublicUserById($id: String!) {
publicUserById(id: $id) {
id
name
avatarUrl
}
}
`,
{ id }
);
return res.publicUserById;
}
export async function sendChangeEmail(
app: TestingApp,
email: string,