Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. var write = (orgId = "0000000", c = 100) => {
  2. var doc = {
  3. "organization": "bi-standortmanager-organization_" + orgId,
  4. "unit": "000",
  5. "name": "Test000",
  6. "description": "Description of Test000",
  7. "zipcode": "",
  8. "zipname": "",
  9. "additional": "",
  10. "state": true
  11. };
  12. for(var i = 0; i < c; i++) {
  13. var str = i.toString().padStart(3, "0");
  14. doc.unit = str;
  15. doc.name = "Test" + str;
  16. doc.description = "Description of Test" + str;
  17. fetch("bi_standortmanager?bi_action=create&bi_tag=units&bi_storetype=managed", {
  18. method: "POST",
  19. body: JSON.stringify(doc)
  20. });
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement