Fixed employees without roles filter
This commit is contained in:
@@ -16,6 +16,7 @@ function generateEmployees(amount = 10) {
|
||||
const lastName = faker.name.lastName();
|
||||
const currentTjanster = chooseRandom(TJANSTER, faker.datatype.number({ min: 1, max: TJANSTER.length }));
|
||||
const currentOrganizations = chooseRandom(ORGANIZATIONS, faker.datatype.number({ min: 1, max: 5 }));
|
||||
const hasBehorigheter = Math.random() > 0.1;
|
||||
|
||||
const employee = {
|
||||
ciamUserId: faker.datatype.uuid(),
|
||||
@@ -30,10 +31,11 @@ function generateEmployees(amount = 10) {
|
||||
min: 1000,
|
||||
max: 9999,
|
||||
})}`,
|
||||
tjanst: currentTjanster.map(tjanst => tjanst.name),
|
||||
tjansteKoder: currentTjanster.map(tjanst => tjanst.code),
|
||||
utforandeVerksamhet: currentOrganizations.map(organization => organization.name),
|
||||
utforandeVerksamhetIds: currentOrganizations.map(organization => organization.id),
|
||||
roles: hasBehorigheter ? ['Admin'] : [],
|
||||
tjanst: hasBehorigheter ? currentTjanster.map(tjanst => tjanst.name) : [],
|
||||
tjansteKoder: hasBehorigheter ? currentTjanster.map(tjanst => tjanst.code) : [],
|
||||
utforandeVerksamhet: hasBehorigheter ? currentOrganizations.map(organization => organization.name) : [],
|
||||
utforandeVerksamhetIds: hasBehorigheter ? currentOrganizations.map(organization => organization.id) : [],
|
||||
};
|
||||
|
||||
employees.push(employee);
|
||||
|
||||
@@ -15,7 +15,7 @@ server.use(
|
||||
'/users/:id': '/employees?ciamUserId=:id',
|
||||
'/users*': '/employees$1',
|
||||
'/employees*search=*': '/employees$1fullName_like=$2',
|
||||
'/employees*onlyEmployeesWithoutAuthorization=*': '/employees$1authorizations.length_gte=1',
|
||||
'/employees*onlyEmployeesWithoutAuthorization=*': '/employees$1roles.length_lte=0',
|
||||
'/employees/invite': '/invites',
|
||||
'/employees*': '/employees$1',
|
||||
'/participants': '/participants?_embed=employees',
|
||||
|
||||
Reference in New Issue
Block a user