primevue-mirror/service/CustomerService.js

28 lines
923 B
JavaScript
Raw Normal View History

2020-07-02 15:17:07 +00:00
export default class CustomerService {
2020-03-03 15:45:11 +00:00
2021-10-05 07:41:07 +00:00
getCustomersSmall() {
2022-09-12 14:07:51 +00:00
return fetch('/demo/data/customers-small.json').then(res => res.json())
2021-10-05 07:41:07 +00:00
.then(d => d.data);
}
getCustomersMedium() {
2022-09-12 14:07:51 +00:00
return fetch('/demo/data/customers-medium.json').then(res => res.json())
2021-10-05 07:41:07 +00:00
.then(d => d.data);
}
2020-03-04 12:10:34 +00:00
2021-10-05 07:41:07 +00:00
getCustomersLarge() {
2022-09-12 14:07:51 +00:00
return fetch('/demo/data/customers-large.json').then(res => res.json())
2021-10-05 07:41:07 +00:00
.then(d => d.data);
}
2020-03-04 12:10:34 +00:00
2021-10-05 07:41:07 +00:00
getCustomersXLarge() {
2022-09-12 14:07:51 +00:00
return fetch('/demo/data/customers-xlarge.json').then(res => res.json())
2021-10-05 07:41:07 +00:00
.then(d => d.data);
}
2020-03-04 12:10:34 +00:00
2021-10-05 07:41:07 +00:00
getCustomers(params) {
const queryParams = params ? Object.keys(params).map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k])).join('&') : '';
2021-10-05 07:41:07 +00:00
return fetch('https://www.primefaces.org/data/customers?' + queryParams).then(res => res.json())
}
}