Bugzilla – Attachment 144719 Details for
Bug 32474
Implement infinite scroll in vue-select
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test data population script
ERMDataPopulation.js (text/javascript), 3.86 KB, created by
Matt Blenkinsop
on 2022-12-19 16:56:07 UTC
(
hide
)
Description:
Test data population script
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2022-12-19 16:56:07 UTC
Size:
3.86 KB
patch
obsolete
>// BASIC AUTH MUST BE ENABLED >const url = 'http://localhost:8081/api/v1/' > >// Edit number of inputs >const numberOfAgreements = 100 >const numberOfLicenses = 100 >const numberOfVendors = 100 >const numberOfPackages = 100 > >const createAgreements = async (del) => { > const requestType = del ? 'DELETE' : 'POST' > > for( let i = 1; i <= numberOfAgreements; i++){ > const data = del ? {} : { > name: i, > status: 'Lorem Ipsum', > is_perpetual: true > } > const requestParams = del ? `erm/agreements/${i}` : 'erm/agreements' > try { > const request = await fetch(url + requestParams, { > method: requestType, > body: JSON.stringify(data), > headers: { > 'Content-Type': 'application/json', > 'Authorization': 'Basic ' + btoa('koha:koha') > } > }) > const response = await request.json() > console.log(response) > } catch (error) { > console.log('Error: ' + error.message) > } > } >} > >const createLicenses = async (del) => { > const requestType = del ? 'DELETE' : 'POST' > > for( let i = 1; i <= numberOfLicenses; i++){ > const data = del ? {} : { > name: i, > type: 'Local', > status: 'Active' > } > const requestParams = del ? `erm/licenses/${i}` : 'erm/licenses' > try { > const request = await fetch(url + requestParams, { > method: requestType, > body: JSON.stringify(data), > headers: { > 'Content-Type': 'application/json', > 'Authorization': 'Basic ' + btoa('koha:koha') > } > }) > const response = await request.json() > console.log(response) > } catch (error) { > console.log('Error: ' + error.message) > } > } >} > >const createVendors = async (del) => { > const requestType = del ? 'DELETE' : 'POST' > // There is already a demo vendor "My Vendor" created in the dev environment so this starts from Id: 2 > for( let i = 2; i <= numberOfVendors; i++){ > const data = del ? {} : { > name: i, > active: true > } > const requestParams = del ? `acquisitions/vendors/${i}` : 'acquisitions/vendors' > try { > const request = await fetch(url + requestParams, { > method: requestType, > body: JSON.stringify(data), > headers: { > 'Content-Type': 'application/json', > 'Authorization': 'Basic ' + btoa('koha:koha') > } > }) > const response = await request.json() > console.log(response) > } catch (error) { > console.log('Error: ' + error.message) > } > } >} > >const createPackages = async (del) => { > const requestType = del ? 'DELETE' : 'POST' > > for( let i = 1; i <= numberOfPackages; i++){ > const data = del ? {} : { > name: i, > } > const requestParams = del ? `erm/eholdings/local/packages/${i}` : 'erm/eholdings/local/packages' > try { > const request = await fetch(url + requestParams, { > method: requestType, > body: JSON.stringify(data), > headers: { > 'Content-Type': 'application/json', > 'Authorization': 'Basic ' + btoa('koha:koha') > } > }) > const response = await request.json() > console.log(response) > } catch (error) { > console.log('Error: ' + error.message) > } > } >} > >//Uncomment to add new entries >createAgreements() >createLicenses() >createVendors() >createPackages() > >// Uncomment to delete entries >// createAgreements('delete') >// createLicenses('delete') >// createVendors('delete') >// createPackages('delete')
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 32474
:
144614
|
144719
|
144720
|
145143
|
145144
|
145154
|
150030
|
150031
|
150282
|
150283
|
150284
|
150287
|
150305
|
150308
|
150309
|
153110
|
153111
|
153112
|
153113
|
154094
|
156410
|
156470
|
156471
|
156472
|
156473
|
156474
|
156475
|
156476
|
156477
|
156478
|
156479
|
156481
|
156482
|
156483
|
156504
|
156505
|
159327
|
159328
|
159329
|
159330
|
159340
|
159343
|
159386
|
159389
|
159395
|
159397
|
159398
|
159399
|
159400
|
159401
|
159402
|
159403
|
159404
|
159405
|
159406
|
159407
|
161724