Skip to content

Commit

Permalink
page builder end point added
Browse files Browse the repository at this point in the history
  • Loading branch information
khwaleed96 committed Jul 3, 2023
1 parent ccbeadc commit a43fc32
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
9 changes: 9 additions & 0 deletions API/PageBuilder/PageBuilder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const Request = require('../../Request');

module.exports = {
// Get Merchant Page
getMerchantPage(payload) {
const url = `/public/v1/page-builder/builder/page`
return Request.get(`${url}`, { params: { ...payload } })
},
}
4 changes: 1 addition & 3 deletions Request.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
const axios = require('axios')
// const axiosRetry = require('axios-retry')

// Get Base URL
const api_url_dev = 'https://api.hyperzod.dev';
const api_url_production = 'https://api.hyperzod.app';

const API = axios.create({
headers: { 'Content-Type': 'application/json' }
headers: { 'Content-Type': 'application/json' },
});

API.interceptors.request.use(async config => {
config.baseURL = (window.HYPERZOD_API_ENV == 'production' ? api_url_production : api_url_dev);
return config;
}, error => Promise.reject(error));

// axiosRetry(API, { retries: 3 });

module.exports = API

Expand Down
4 changes: 3 additions & 1 deletion RequestFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Payment = require('./API/Payment/Payment');
const Notification = require('./API/Notification/Notification');
const Upload = require('./API/Upload/Upload');
const Home = require('./API/Home/Home');
const PageBuilder = require('./API/PageBuilder/PageBuilder');

const repositories = {
global: Global,
Expand All @@ -37,7 +38,8 @@ const repositories = {
payment: Payment,
notification: Notification,
upload: Upload,
home: Home
home: Home,
pageBuilder: PageBuilder
}

const RequestFactory = {
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Payment = RequestFactory.get('payment')
const Notification = RequestFactory.get('notification')
const Upload = RequestFactory.get('upload')
const Home = RequestFactory.get('home')
const PageBuilder = RequestFactory.get('pageBuilder')

window.HYPERZOD_API_ENV = 'dev'; // dev, production

Expand Down Expand Up @@ -83,5 +84,6 @@ module.exports = {
Payment,
Notification,
Upload,
Home
Home,
PageBuilder
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.0.49"
}
"version": "1.0.50"
}

0 comments on commit a43fc32

Please sign in to comment.