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