Skip to content

Commit

Permalink
Refactor on CustomerService
Browse files Browse the repository at this point in the history
  • Loading branch information
ulasturann committed Mar 15, 2023
1 parent 7df9e25 commit c9e3ab8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
reactStrictMode: process.env.NODE_ENV === 'production' ? false : true,
trailingSlash: true,
publicRuntimeConfig: {
apiUrl: process.env.NODE_ENV === 'production' ? 'https://www.primereact.org/api/data/customers' : '/api/data/customers',
appVersion: process.env.npm_package_version || ''
},
webpack(config) {
Expand Down
6 changes: 1 addition & 5 deletions service/CustomerService.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import getConfig from 'next/config';

const { apiUrl } = getConfig().publicRuntimeConfig;

export const CustomerService = {
getData() {
return [
Expand Down Expand Up @@ -9031,6 +9027,6 @@ export const CustomerService = {
.join('&')
: '';

return fetch(apiUrl + '?' + queryParams).then((res) => res.json());
return fetch('/api/data/customers?' + queryParams).then((res) => res.json());
}
};

0 comments on commit c9e3ab8

Please sign in to comment.