| @@ -5,6 +5,7 @@ | |||||
| "REACT_APP_BACKEND_PROTOCOL": "http", | "REACT_APP_BACKEND_PROTOCOL": "http", | ||||
| "REACT_APP_BACKEND_HOST": "localhost", | "REACT_APP_BACKEND_HOST": "localhost", | ||||
| "REACT_APP_BACKEND_PORT": "8090", | "REACT_APP_BACKEND_PORT": "8090", | ||||
| "REACT_APP_ADOBE_API_KEY": "97e02339319940a28d1181b1a06076a2", | |||||
| "REACT_APP_BACKEND_API_PATH": "/api" | "REACT_APP_BACKEND_API_PATH": "/api" | ||||
| }, | }, | ||||
| "2fi-production": { | "2fi-production": { | ||||
| @@ -12,7 +13,8 @@ | |||||
| "REACT_APP_URL": "https://forms.lioner.com/", | "REACT_APP_URL": "https://forms.lioner.com/", | ||||
| "REACT_APP_BACKEND_PROTOCOL": "https", | "REACT_APP_BACKEND_PROTOCOL": "https", | ||||
| "REACT_APP_BACKEND_HOST": "forms.lioner.com", | "REACT_APP_BACKEND_HOST": "forms.lioner.com", | ||||
| "REACT_APP_BACKEND_PORT": "8090", | |||||
| "REACT_APP_BACKEND_PORT": "8090", | |||||
| "REACT_APP_ADOBE_API_KEY": "ee4433f258a74641ae6d502fd41cf703", | |||||
| "REACT_APP_BACKEND_API_PATH": "/api" | "REACT_APP_BACKEND_API_PATH": "/api" | ||||
| } | } | ||||
| } | } | ||||
| @@ -11,6 +11,7 @@ const hostPort = process.env.REACT_APP_BACKEND_PORT | |||||
| export const hostPath = `${process.env.REACT_APP_BACKEND_PROTOCOL}://${hostname}:${hostPort}` | export const hostPath = `${process.env.REACT_APP_BACKEND_PROTOCOL}://${hostname}:${hostPort}` | ||||
| export const apiPath = `${hostPath}/api` | export const apiPath = `${hostPath}/api` | ||||
| export const appURL = `${process.env.REACT_APP_URL}` | export const appURL = `${process.env.REACT_APP_URL}` | ||||
| export const adobeAPIKey = `${process.env.REACT_APP_ADOBE_API_KEY}` | |||||
| export const isUserLoggedIn = () => { | export const isUserLoggedIn = () => { | ||||
| return localStorage.getItem('userData') && localStorage.getItem(useJwt.jwtConfig.storageTokenKeyName) | return localStorage.getItem('userData') && localStorage.getItem(useJwt.jwtConfig.storageTokenKeyName) | ||||
| @@ -1,6 +1,6 @@ | |||||
| import React, { useEffect, useRef, useState } from 'react'; | import React, { useEffect, useRef, useState } from 'react'; | ||||
| import { useParams } from 'react-router-dom'; // Import useParams | import { useParams } from 'react-router-dom'; // Import useParams | ||||
| import { apiPath, GET_PDF_PATH } from "../../../auth/utils"; | |||||
| import { apiPath, adobeAPIKey } from "../../../auth/utils"; | |||||
| const PdfViewer = ({ pdfUrl, formCode }) => { | const PdfViewer = ({ pdfUrl, formCode }) => { | ||||
| const { id } = useParams(); | const { id } = useParams(); | ||||
| @@ -45,7 +45,7 @@ const PdfViewer = ({ pdfUrl, formCode }) => { | |||||
| const loadAdobeSDK = () => { | const loadAdobeSDK = () => { | ||||
| if (window.AdobeDC) { | if (window.AdobeDC) { | ||||
| const adobeDCView = new window.AdobeDC.View({ | const adobeDCView = new window.AdobeDC.View({ | ||||
| clientId: '97e02339319940a28d1181b1a06076a2', | |||||
| clientId: `${adobeAPIKey}`, | |||||
| divId: 'adobe-dc-view', | divId: 'adobe-dc-view', | ||||
| }); | }); | ||||
| @@ -73,7 +73,7 @@ const PdfViewer = ({ pdfUrl, formCode }) => { | |||||
| window.AdobeDC.View.Enum.CallbackType.SAVE_API, | window.AdobeDC.View.Enum.CallbackType.SAVE_API, | ||||
| async (metaData, content, options) => { | async (metaData, content, options) => { | ||||
| try { | try { | ||||
| const saveUrl = `http://localhost:8090/api/pdf2/save-pdf?clientId=${encodeURIComponent(id)}&formCode=${encodeURIComponent(formCode)}`; | |||||
| const saveUrl = `${apiPath}/pdf2/save-pdf?clientId=${encodeURIComponent(id)}&formCode=${encodeURIComponent(formCode)}`; | |||||
| console.log('Saving to:', saveUrl); | console.log('Saving to:', saveUrl); | ||||
| console.log('Authorization header:', `Bearer ${token}`); | console.log('Authorization header:', `Bearer ${token}`); | ||||
| const response = await fetch(saveUrl, { | const response = await fetch(saveUrl, { | ||||