added hashing on api calls

This commit is contained in:
2022-07-12 12:49:26 +01:00
parent f23ad2a300
commit be9f86b6b2
13 changed files with 234 additions and 158 deletions
+17 -8
View File
@@ -15,10 +15,9 @@ import Dropzone, { useDropzone } from "react-dropzone";
import _ from "lodash";
import { connect, useDispatch } from "react-redux";
import {
getFilesFromBlob,
getFilesFromBlobHashed,
deleteBlob,
downloadBlob,
hashAPIPath,
} from "../../actions";
import { setFilesForAppeal } from "../../store/appealType/action";
import Link from "next/link";
@@ -1456,13 +1455,18 @@ const RenderFileUpload = (field) => {
"$..[?(@.documentType=='" + field.documentTypeCode + "')]"
);
const deleteThisBlob = async (containerName, blobName) => {
console.log(containerName, blobName);
deleteBlob(containerName, blobName)
const deleteThisBlob = async (
containerName,
blobName,
deleteblobhash,
getblobshash
) => {
//console.log(containerName, blobName, deleteblobhash);
deleteBlob(containerName, blobName, deleteblobhash)
.then((data) => data)
.then(() => {
getFilesFromBlob(containerName).then((newfilelist) =>
field.setFilesForAppeal(newfilelist)
getFilesFromBlobHashed(containerName, getblobshash).then(
(newfilelist) => field.setFilesForAppeal(newfilelist)
);
});
};
@@ -1538,7 +1542,12 @@ const RenderFileUpload = (field) => {
<span
className="govuk-summary-list__actionLink watched_link govuk-!-margin-right-5 govuk-!-text-align-left"
onClick={() => {
deleteThisBlob(field.ticketnumber, blob.name);
deleteThisBlob(
field.ticketnumber,
blob.name,
blob.hasheddeletepath,
blob.hashgetblobs
);
}}
title="Remove this file"
>