primevue-mirror/service/CustomerService.js

28 lines
919 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() {
return fetch('demo/data/customers-small.json').then(res => res.json())
.then(d => d.data);
}
getCustomersMedium() {
return fetch('demo/data/customers-medium.json').then(res => res.json())
.then(d => d.data);
}
2020-03-04 12:10:34 +00:00
2021-10-05 07:41:07 +00:00
getCustomersLarge() {
return fetch('demo/data/customers-large.json').then(res => res.json())
.then(d => d.data);
}
2020-03-04 12:10:34 +00:00
2021-10-05 07:41:07 +00:00
getCustomersXLarge() {
return fetch('demo/data/customers-xlarge.json').then(res => res.json())
.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())
}
}