Added more data to mock-api and multiple sub-pages
This commit is contained in:
committed by
Erik Tiekstra
parent
9d82c91348
commit
cb5cb8b486
@@ -1,21 +1,22 @@
|
||||
import faker from 'faker';
|
||||
import services from './services.js';
|
||||
|
||||
faker.locale = 'sv';
|
||||
|
||||
const AVAILABLE_SERVICES = ['KROM', 'STOM', 'KVL'];
|
||||
const SERVICES = services.generate();
|
||||
const STATUSES = ['active', 'follow-up'];
|
||||
const STEPS = ['Gemensam planering', 'Periodisk rapport', 'Resultatrapport', 'Slutrapport'];
|
||||
|
||||
function generateParticipants(amount = 10) {
|
||||
const participants = [];
|
||||
|
||||
for (let id = 0; id <= amount; ++id) {
|
||||
for (let id = 1; id <= amount; ++id) {
|
||||
participants.push({
|
||||
id,
|
||||
firstName: faker.name.firstName(),
|
||||
lastName: faker.name.lastName(),
|
||||
status: STATUSES[Math.floor(Math.random() * STATUSES.length)],
|
||||
service: AVAILABLE_SERVICES[Math.floor(Math.random() * AVAILABLE_SERVICES.length)],
|
||||
service: SERVICES[Math.floor(Math.random() * SERVICES.length)].name,
|
||||
nextStep: STEPS[Math.floor(Math.random() * STEPS.length)],
|
||||
errandNumber: faker.random.number({ min: 100000, max: 999999 }),
|
||||
startDate: faker.date.recent(),
|
||||
|
||||
Reference in New Issue
Block a user