diff --git a/env/env.cloud b/env/env.cloud index 6b72a4b..19b975f 100644 --- a/env/env.cloud +++ b/env/env.cloud @@ -1,3 +1,5 @@ VITE_APP_MODE=production VITE_BASE_API_URL=http://103.187.147.241:30050/api VITE_BASE_API_REPORT_URL=http://103.187.147.241:30050/api + +VITE_BASE_API_URL_LOCAL=https://api.sky.eigen.co.id/api \ No newline at end of file diff --git a/env/env.development b/env/env.development index e9c0373..8f8e928 100644 --- a/env/env.development +++ b/env/env.development @@ -1,3 +1,5 @@ VITE_APP_MODE=production VITE_BASE_API_URL=https://api.sky.eigen.co.id/api VITE_BASE_API_REPORT_URL=https://api.sky.eigen.co.id/api + +VITE_BASE_API_URL_LOCAL=https://api.sky.eigen.co.id/api diff --git a/env/env.production-offline b/env/env.production-offline index 2c6687b..1050e15 100644 --- a/env/env.production-offline +++ b/env/env.production-offline @@ -1,3 +1,5 @@ VITE_APP_MODE=production VITE_BASE_API_URL=http://172.16.2.101:30050/api VITE_BASE_API_REPORT_URL=http://172.16.2.101:30050/api + +VITE_BASE_API_URL_LOCAL=http://172.16.2.101:30050/api \ No newline at end of file diff --git a/env/env.production-online b/env/env.production-online index 4dbed92..c9a3d6f 100644 --- a/env/env.production-online +++ b/env/env.production-online @@ -1,3 +1,5 @@ VITE_APP_MODE=production VITE_BASE_API_URL=https://api.office.weplayground.id/api VITE_BASE_API_REPORT_URL=https://api.office.weplayground.id/api + +VITE_BASE_API_URL_LOCAL=https://api.office.weplayground.id/api \ No newline at end of file diff --git a/src/apps/admin/layout/components/local-data-configuration.tsx b/src/apps/admin/layout/components/local-data-configuration.tsx index 883b00c..46280c8 100644 --- a/src/apps/admin/layout/components/local-data-configuration.tsx +++ b/src/apps/admin/layout/components/local-data-configuration.tsx @@ -1,7 +1,7 @@ import axios from 'axios'; import { useEffect, useState } from 'react'; import { App, Button, Col, InputNumber, InputNumberProps, Modal, ModalProps, Row, Slider } from 'antd'; -import { API_URL } from '@pos/base'; +import { API_URL, BASE_API_URL_LOCAL } from '@pos/base'; export default function LocalDataConfiguration(modalProps: ModalProps) { const { modal, notification } = App.useApp(); @@ -27,7 +27,7 @@ export default function LocalDataConfiguration(modalProps: ModalProps) { async function handleSave(value: number) { setLoadingSave(true); await axios - .put(API_URL.EDIT_TRANSACTION_SETTING, { id: configData?.id, value }) + .put(API_URL.EDIT_TRANSACTION_SETTING, { id: configData?.id, value }, { baseURL: BASE_API_URL_LOCAL }) .then(() => { notification.success({ message: 'Sukses', @@ -50,7 +50,7 @@ export default function LocalDataConfiguration(modalProps: ModalProps) { async function handleGetData() { setLoadingGet(true); await axios - .get(API_URL.GET_TRANSACTION_SETTING) + .get(API_URL.GET_TRANSACTION_SETTING, { baseURL: BASE_API_URL_LOCAL }) .then((res) => { const data = res.data.data; const respValue = data?.value; diff --git a/src/base/infrastructure/constants/environment/index.ts b/src/base/infrastructure/constants/environment/index.ts index edadee5..64f6e2d 100644 --- a/src/base/infrastructure/constants/environment/index.ts +++ b/src/base/infrastructure/constants/environment/index.ts @@ -8,3 +8,5 @@ export const EMBED_DASHBOARD_ID = import.meta.env.VITE_EMBED_DASHBOARD_ID; export const DOWLOAD_POS_WINDOWS_URL = import.meta.env.VITE_DOWLOAD_POS_WINDOWS_URL; export const DOWLOAD_POS_LINUX_DEB_URL = import.meta.env.VITE_DOWLOAD_POS_LINUX_DEB_URL; export const DOWLOAD_POS_LINUX_SNAP_URL = import.meta.env.VITE_DOWLOAD_POS_LINUX_SNAP_URL; + +export const BASE_API_URL_LOCAL = import.meta.env.VITE_BASE_API_URL_LOCAL;