Updated employees mock-api

This commit is contained in:
Erik Tiekstra
2021-09-01 10:27:04 +02:00
parent e4f5802f97
commit a4bc9aa37c

View File

@@ -7,7 +7,7 @@ faker.locale = 'sv';
const TJANSTER = tjanster.generate();
const UTFORANDEVERKSAMHETER = utforandeVerksamheter.generate();
const ROLES = ['ReportAndPlanning', 'ReceiveDeltagare', 'AuthAdmin', 'ContactPerson'];
const ROLES = ['MSFA_AuthAdmin', 'MSFA_ReceiveDeltagare', 'MSFA_ReportAndPlanning'];
function generateEmployees(amount = 10) {
const employees = [];
@@ -34,8 +34,8 @@ function generateEmployees(amount = 10) {
})}`,
email: faker.internet.email(firstName.toLowerCase(), lastName.toLowerCase()),
roles: hasBehorigheter
? ['OrganizationUser', ...chooseRandom(ROLES, faker.datatype.number({ min: 1, max: ROLES.length }))]
: ['OrganizationUser'],
? ['MSFA_Standard', ...chooseRandom(ROLES, faker.datatype.number({ min: 1, max: ROLES.length }))]
: ['MSFA_Standard'],
tjanst: hasBehorigheter ? currentTjanster.map(tjanst => tjanst.label) : [],
tjansteKoder: hasBehorigheter ? currentTjanster.map(tjanst => tjanst.id) : [],
allaUtforandeVerksamheter: faker.datatype.boolean(),