feat(server): team quota (#8955)

This commit is contained in:
DarkSky
2024-12-09 17:51:54 +08:00
committed by GitHub
parent 8fe188e773
commit 9365958a02
51 changed files with 1997 additions and 218 deletions
+4 -2
View File
@@ -10,6 +10,8 @@ import { sessionUser } from '../../src/core/auth/service';
import { UserService, type UserType } from '../../src/core/user';
import { gql } from './common';
export type UserAuthedType = UserType & { token: ClientTokenType };
export async function internalSignIn(app: INestApplication, userId: string) {
const auth = app.get(AuthService);
@@ -49,7 +51,7 @@ export async function signUp(
email: string,
password: string,
autoVerifyEmail = true
): Promise<UserType & { token: ClientTokenType }> {
): Promise<UserAuthedType> {
const user = await app.get(UserService).createUser({
name,
email,
@@ -176,7 +178,7 @@ export async function changeEmail(
userToken: string,
token: string,
email: string
): Promise<UserType & { token: ClientTokenType }> {
): Promise<UserAuthedType> {
const res = await request(app.getHttpServer())
.post(gql)
.auth(userToken, { type: 'bearer' })