Updated some nameing to fit with the rest of the models
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/pr Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/pr Build is passing
				
			ref #37
This commit is contained in:
		@@ -67,7 +67,7 @@ export class CreateUser {
 | 
			
		||||
     * Optional.
 | 
			
		||||
     */
 | 
			
		||||
    @IsOptional()
 | 
			
		||||
    group?: number[] | number
 | 
			
		||||
    groups?: number[] | number
 | 
			
		||||
 | 
			
		||||
    //TODO: ProfilePics
 | 
			
		||||
 | 
			
		||||
@@ -95,13 +95,16 @@ export class CreateUser {
 | 
			
		||||
        return newUser;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get's all groups for this user by their id's;
 | 
			
		||||
     */
 | 
			
		||||
    public async getGroups() {
 | 
			
		||||
        if (!this.group) { return null; }
 | 
			
		||||
        if (!this.groups) { return null; }
 | 
			
		||||
        let groups = new Array<UserGroup>();
 | 
			
		||||
        if (!Array.isArray(this.group)) {
 | 
			
		||||
            this.group = [this.group]
 | 
			
		||||
        if (!Array.isArray(this.groups)) {
 | 
			
		||||
            this.groups = [this.groups]
 | 
			
		||||
        }
 | 
			
		||||
        for (let group of this.group) {
 | 
			
		||||
        for (let group of this.groups) {
 | 
			
		||||
            let found = await getConnectionManager().get().getRepository(UserGroup).findOne({ id: group });
 | 
			
		||||
            if (!found) { throw new UserGroupNotFoundError(); }
 | 
			
		||||
            groups.push(found);
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ export default class SeedUsers implements Seeder {
 | 
			
		||||
        initialUser.lastname = "demo";
 | 
			
		||||
        initialUser.username = "demo";
 | 
			
		||||
        initialUser.password = "demo";
 | 
			
		||||
        initialUser.group = group;
 | 
			
		||||
        initialUser.groups = group;
 | 
			
		||||
        return await connection.getRepository(User).save(await initialUser.toUser());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user