mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into database_transaction_signatures
This commit is contained in:
commit
3cdaf860dd
@ -1 +0,0 @@
|
||||
export { LoginUserRoles } from './0003-login_server_tables/LoginUserRoles'
|
||||
@ -2,7 +2,6 @@ import { Balance } from './Balance'
|
||||
import { LoginElopageBuys } from './LoginElopageBuys'
|
||||
import { LoginEmailOptIn } from './LoginEmailOptIn'
|
||||
import { LoginUser } from './LoginUser'
|
||||
import { LoginUserRoles } from './LoginUserRoles'
|
||||
import { LoginUserBackup } from './LoginUserBackup'
|
||||
import { Migration } from './Migration'
|
||||
import { ServerUser } from './ServerUser'
|
||||
@ -20,7 +19,6 @@ export const entities = [
|
||||
LoginElopageBuys,
|
||||
LoginEmailOptIn,
|
||||
LoginUser,
|
||||
LoginUserRoles,
|
||||
LoginUserBackup,
|
||||
Migration,
|
||||
ServerUser,
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
import Faker from 'faker'
|
||||
import { define } from 'typeorm-seeding'
|
||||
import { LoginUserRoles } from '../../entity/LoginUserRoles'
|
||||
import { LoginUserRolesContext } from '../interface/UserContext'
|
||||
|
||||
define(LoginUserRoles, (faker: typeof Faker, context?: LoginUserRolesContext) => {
|
||||
if (!context) context = {}
|
||||
if (!context.userId) throw new Error('LoginUserRoles: No userId present!')
|
||||
if (!context.roleId) throw new Error('LoginUserRoles: No roleId present!')
|
||||
|
||||
const userRoles = new LoginUserRoles()
|
||||
userRoles.userId = context.userId
|
||||
userRoles.roleId = context.roleId
|
||||
|
||||
return userRoles
|
||||
})
|
||||
@ -16,7 +16,6 @@ import { User } from '../../../entity/User'
|
||||
import { LoginUser } from '../../../entity/LoginUser'
|
||||
import { LoginUserBackup } from '../../../entity/LoginUserBackup'
|
||||
import { ServerUser } from '../../../entity/ServerUser'
|
||||
import { LoginUserRoles } from '../../../entity/LoginUserRoles'
|
||||
import { Balance } from '../../../entity/Balance'
|
||||
import { Transaction } from '../../../entity/Transaction'
|
||||
import { UserTransaction } from '../../../entity/UserTransaction'
|
||||
@ -31,10 +30,6 @@ export const userSeeder = async (factory: Factory, userData: UserInterface): Pro
|
||||
|
||||
if (userData.isAdmin) {
|
||||
await factory(ServerUser)(createServerUserContext(userData)).create()
|
||||
|
||||
// This is crazy: we just need the relation to roleId but no role at all
|
||||
// It works with LoginRoles empty!!
|
||||
await factory(LoginUserRoles)(createLoginUserRolesContext(loginUser)).create()
|
||||
}
|
||||
|
||||
if (userData.addBalance) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user