upodated rep file upload

This commit is contained in:
2024-12-18 12:39:17 +00:00
parent 54728d9565
commit 97cfeb562a
13 changed files with 433 additions and 108 deletions
+12 -4
View File
@@ -30,7 +30,7 @@
*/
import { hashAPIPath } from "../../../actions";
import { getBlobs } from "../../../actions/azurestorage";
import { getBlobs, getRepsFilesBlobs } from "../../../actions/azurestorage";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
@@ -57,9 +57,17 @@ ApiProxy.get(async (req, res) => {
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
await getBlobs(containerName, casefolderID).then((data) => {
return res.status(200).json({ "value": [data] });
});
casefolderID.split("/").length > 1
? await getRepsFilesBlobs(
containerName,
casefolderID.split("/")[0],
casefolderID.split("/")[1]
).then((data) => {
return res.status(200).json({ "value": [data] });
})
: await getBlobs(containerName, casefolderID).then((data) => {
return res.status(200).json({ "value": [data] });
});
} else {
return res.status(400).json();
}
+5 -1
View File
@@ -34,7 +34,11 @@ import {
setAwaitingSubmissionDetails,
setAwaitingSubmissionFromBlob,
} from "../../store/awaitingSubmission/action";
import { setShowReps, setLocale } from "../../store/currentView/action";
import {
setShowReps,
setLocale,
setFilesForRepresentation,
} from "../../store/currentView/action";
import { setMyCases, setMyCasesDetails } from "../../store/myCases/action";
import {
setMyRepresentations,
+22
View File
@@ -13,6 +13,7 @@ import {
getCase,
getPortalModuleDetails,
getBasicSearch,
getFilesFromBlob,
} from "../../actions";
import { getFormCollectionByID } from "../../components/utils";
import Breadcrumbs from "../../components/breadcrumbs";
@@ -31,6 +32,7 @@ import { getSearchDetails } from "../../components/utils";
import {
setCurrentReference,
setCurrentView,
setFilesForRepresentations,
setRepresentationCapacity,
} from "../../store/currentView/action";
import {
@@ -49,6 +51,7 @@ import {
setMySubmittedReps,
setMySubmittedRepsDetails,
} from "../../store/myRepresentations/action";
import { getRepsFilesBlobs } from "../../actions/azurestorage";
const RepresentationF = (props) => {
const { footerLinks, pages } = props;
@@ -201,6 +204,7 @@ const RepresentationF = (props) => {
setShowQuestionnaireSection={
setShowQuestionnaireSection
}
setCurrentReference={setCurrentReference}
showQuestionnaireSection={showQuestionnaireSection}
/>
</div>
@@ -298,7 +302,24 @@ export const getServerSideProps = wrapper.getServerSideProps(
"repDetails": result,
})
);
store.dispatch(
setRepresentationCapacity(result.representationCapacity)
);
// console.log(
// "===========================\n getting files",
// result.filesList
// );
const repsFileListObj = await getRepsFilesBlobs(
result.containerID,
result.caseRef,
result.repfile_name
);
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setFilesForRepresentations(repsFileListObj));
return {
props: {
@@ -340,6 +361,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
: "",
})
);
store.dispatch(setAccountDetails(accountDetails));
// return {