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) {
|
2021-12-06 08:45:21 +00:00
|
|
|
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())
|
|
|
|
}
|
|
|
|
}
|