Closed thiagomata closed 8 years ago
The people list always returns the same people. To be more random, as a search, may be useful create a way to make the personIndex be random. Something like:
{ "people": [ {{#repeat 2}} { "id": {{randomIndex}}, "firstName": "{{firstName}}", "lastName": "{{lastName}}", "email": "{{email}}", "work": "{{company}}", "age": {{number 20 50}}, "optedin": {{boolean}} } {{/repeat}} ] }
Creating something like
{ "people": [ { "id": 71, "firstName": "Travis", "lastName": "Remus", "email": "travis.remus@keycast.com", "work": "Keycast", "age": 21, "optedin": true }, { "id": 48, "firstName": "Raymond", "lastName": "Gamble", "email": "raymond.gamble@fastmart.com", "work": "FastMart", "age": 45, "optedin": false } ] }
This is now the default mode of dummyjson. If you need the same data every time you can use a random seed https://github.com/webroo/dummy-json#seeded-random-data
The people list always returns the same people. To be more random, as a search, may be useful create a way to make the personIndex be random. Something like:
Creating something like