change from datamapper to active pattern (we mix it now)

This commit is contained in:
Einhornimmond 2021-09-30 18:40:15 +02:00
parent 58da33eb86
commit bf5913b363
2 changed files with 549 additions and 588 deletions

View File

@ -3,7 +3,6 @@
import { Resolver, Query, Args, Arg, Authorized, Ctx, UseMiddleware, Mutation } from 'type-graphql'
import { from_hex as fromHex } from 'libsodium-wrappers'
import { getRepository } from 'typeorm'
import CONFIG from '../../config'
import { CheckUsernameResponse } from '../models/CheckUsernameResponse'
import { LoginViaVerificationCode } from '../models/LoginViaVerificationCode'
@ -95,8 +94,7 @@ export class UserResolver {
user.lastName = qluser.lastName
user.username = qluser.username
const repository = getRepository(DbUser)
repository.save(user).catch(() => {
user.save().catch(() => {
throw new Error('error saving user')
})

File diff suppressed because it is too large Load Diff