Update database/src/factories/login-user-backup.factory.ts

Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
This commit is contained in:
Moriz Wahl 2021-11-26 19:31:16 +01:00 committed by GitHub
parent 0f22a2fe1c
commit ff704bd9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,9 @@ import { LoginUserBackup } from '../../entity/LoginUserBackup'
import { LoginUserBackupContext } from '../interface/UserContext'
define(LoginUserBackup, (faker: typeof Faker, context?: LoginUserBackupContext) => {
if (!context) context = {}
if (!context.userId) throw new Error('LoginUserBackup: No userId present!')
if (!context || !context.userId) {
throw new Error('LoginUserBackup: No userId present!')
}
const userBackup = new LoginUserBackup()
// TODO: Get the real passphrase