removed proxy and added endpoints for methods
This commit is contained in:
@@ -12,10 +12,10 @@ import CryptoJS from "crypto-js";
|
||||
import {
|
||||
getBasicSearch,
|
||||
getBasicSearchDetails,
|
||||
getSearchDocumentDetails1,
|
||||
getSearchDocumentHistory1,
|
||||
getSearchDocumentHistory1Paged,
|
||||
getSearchDocumentDetails1Paged,
|
||||
getSearchDocumentDetails,
|
||||
getSearchDocumentHistory,
|
||||
getSearchDocumentHistoryPaged,
|
||||
getSearchDocumentDetailsPaged,
|
||||
getToken,
|
||||
} from "../../actions";
|
||||
|
||||
@@ -105,9 +105,9 @@ const DocumentDetails = (props) => {
|
||||
>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<a
|
||||
href={encryptDocReference(
|
||||
detailsObj.pinswg_isharedocumentreference
|
||||
)}
|
||||
href={
|
||||
detailsObj.pinswg_hashlink
|
||||
}
|
||||
>
|
||||
<span className="results-visually-hidden">
|
||||
{t(
|
||||
@@ -191,23 +191,9 @@ const DocumentDetails = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
const WORDKEY = process.env.NEXT_PUBLIC_HASHKEY;
|
||||
|
||||
const encryptDocReference = (documentRef) => {
|
||||
var hashlink = CryptoJS.HmacSHA256(
|
||||
"documents/download/" + documentRef,
|
||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||
);
|
||||
hashlink = hashlink.toString(CryptoJS.enc.Hex);
|
||||
|
||||
return (
|
||||
"/api/proxy/documents/download/" + documentRef + "?hash=" + hashlink
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const docDetailsObj = async () => {
|
||||
let docObj = await getSearchDocumentDetails1(incidentid)
|
||||
let docObj = await getSearchDocumentDetails(incidentid)
|
||||
.then((data) => {
|
||||
//console.log(data);
|
||||
setDocumentDetails(data);
|
||||
@@ -239,7 +225,7 @@ const DocumentDetails = (props) => {
|
||||
console.log(historyDetail.pinswg_documentid);
|
||||
} else {
|
||||
historyArr.push(
|
||||
getSearchDocumentHistory1(
|
||||
getSearchDocumentHistory(
|
||||
historyDetail.pinswg_documentid
|
||||
)
|
||||
);
|
||||
@@ -252,8 +238,7 @@ const DocumentDetails = (props) => {
|
||||
}, [incidentid, setDocumentHistory, setDocumentDetails]);
|
||||
|
||||
const getDocumentResults = (pageNumber) => {
|
||||
//console.log(advancedSearch, searchString, pageNumber);
|
||||
getSearchDocumentDetails1Paged(incidentid, pageNumber)
|
||||
getSearchDocumentDetailsPaged(incidentid, pageNumber)
|
||||
.then((data) => {
|
||||
//console.log(data);
|
||||
setDocumentDetails(data);
|
||||
@@ -269,10 +254,7 @@ const DocumentDetails = (props) => {
|
||||
};
|
||||
|
||||
const getDocumentDetails = async () => {
|
||||
let docObj = await getSearchDocumentDetails1Paged(
|
||||
incidentid,
|
||||
pageNumber
|
||||
)
|
||||
let docObj = await getSearchDocumentDetailsPaged(incidentid, pageNumber)
|
||||
.then((data) => {
|
||||
//console.log(data);
|
||||
setDocumentDetails(data);
|
||||
@@ -303,7 +285,7 @@ const DocumentDetails = (props) => {
|
||||
console.log(historyDetail.pinswg_documentid);
|
||||
} else {
|
||||
historyArr.push(
|
||||
getSearchDocumentHistory1Paged(
|
||||
getSearchDocumentHistoryPaged(
|
||||
historyDetail.pinswg_documentid,
|
||||
pageNumber
|
||||
)
|
||||
|
||||
@@ -73,12 +73,7 @@ const RepresentationList = (props) => {
|
||||
return (
|
||||
<div className="govuk-summary-list__row" key={key}>
|
||||
<dd className="govuk-summary-list__value govuk-!-font-size-16 ">
|
||||
<a
|
||||
href={
|
||||
"/api/proxy/documents/download/" +
|
||||
detailsObj.pinswg_isharedocumentreference
|
||||
}
|
||||
>
|
||||
<a href={detailsObj.pinswg_hashlink}>
|
||||
<span className="results-visually-hidden">
|
||||
{t("case:documents-name-label")}:
|
||||
</span>
|
||||
|
||||
@@ -207,7 +207,7 @@ let Login = (props) => {
|
||||
<h3 className="heading-small card-heading">
|
||||
{t("home:login-card-title")}
|
||||
</h3>{" "}
|
||||
{/* <form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
<form onSubmit={handleSubmit(onHandleSubmit)}>
|
||||
{validLoginID == false && (
|
||||
<div className="govuk-error-message govuk-form-group--error">
|
||||
Incorrect username or password
|
||||
@@ -254,7 +254,7 @@ let Login = (props) => {
|
||||
{t("home:login-card-button")}
|
||||
</button>
|
||||
</div>
|
||||
</form> */}
|
||||
</form>
|
||||
<div className="govuk-form-group govuk-!-margin-top-4">
|
||||
<p className="govuk-body-xs">
|
||||
<a
|
||||
|
||||
@@ -260,7 +260,7 @@ const DNSSearchResults = (props) => {
|
||||
|
||||
getBasicDNSSearchPaged(pageNumber)
|
||||
.then((data) => {
|
||||
//console.log(data);
|
||||
console.log(data);
|
||||
setSearchResults(data);
|
||||
return data;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user