added hashing on api calls
This commit is contained in:
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user