mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(server): use user model (#9710)
This commit is contained in:
@@ -7,7 +7,8 @@ import {
|
||||
type CurrentUser,
|
||||
} from '../../core/auth';
|
||||
import { sessionUser } from '../../core/auth/service';
|
||||
import { UserService, type UserType } from '../../core/user';
|
||||
import { UserType } from '../../core/user';
|
||||
import { Models } from '../../models';
|
||||
import { gql } from './common';
|
||||
|
||||
export type UserAuthedType = UserType & { token: ClientTokenType };
|
||||
@@ -52,7 +53,7 @@ export async function signUp(
|
||||
password: string,
|
||||
autoVerifyEmail = true
|
||||
): Promise<UserAuthedType> {
|
||||
const user = await app.get(UserService).createUser({
|
||||
const user = await app.get(Models).user.create({
|
||||
name,
|
||||
email,
|
||||
password,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { GlobalExceptionFilter, Runtime } from '../../base';
|
||||
import { GqlModule } from '../../base/graphql';
|
||||
import { AuthGuard, AuthModule } from '../../core/auth';
|
||||
import { UserFeaturesInit1698652531198 } from '../../data/migrations/1698652531198-user-features-init';
|
||||
import { ModelModules } from '../../models';
|
||||
import { ModelsModule } from '../../models';
|
||||
|
||||
export type PermissionEnum = 'Owner' | 'Admin' | 'Write' | 'Read';
|
||||
|
||||
@@ -80,7 +80,7 @@ export async function createTestingModule(
|
||||
? [AppModule]
|
||||
: dedupeModules([
|
||||
...FunctionalityModules,
|
||||
ModelModules,
|
||||
ModelsModule,
|
||||
AuthModule,
|
||||
GqlModule,
|
||||
...imports,
|
||||
|
||||
Reference in New Issue
Block a user