Skip to content

Commit

Permalink
refactor: update resumeUrl to use transactionId and submissionId
Browse files Browse the repository at this point in the history
  • Loading branch information
mwejuli-ch committed Jul 9, 2024
1 parent 859928e commit 5c3d9a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/controllers/resume.submission.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { NextFunction, Request, Response } from "express";
import * as config from "../config";
import { isActiveFeature } from "../utils/feature.flag";
import { getResumePage } from "./shared/common.resume.submission.controller";
import { getUrlWithTransactionIdAndSubmissionId } from "../utils/url";

export const get = (req: Request, res: Response, next: NextFunction) => {
getResumePage(req, res, next, isActiveFeature(config.FEATURE_FLAG_ENABLE_SAVE_AND_RESUME_17102022), config.SOLD_LAND_FILTER_URL);
export const get = async (req: Request, res: Response, next: NextFunction) => {
const { transactionId, overseaEntityId } = req.params;
const resumeUrl: string = isActiveFeature(config.FEATURE_FLAG_ENABLE_REDIS_REMOVAL)
? getUrlWithTransactionIdAndSubmissionId(config.SOLD_LAND_FILTER_WITH_PARAMS_URL, transactionId, overseaEntityId)
: config.SOLD_LAND_FILTER_URL;
await getResumePage(req, res, next, isActiveFeature(config.FEATURE_FLAG_ENABLE_SAVE_AND_RESUME_17102022), resumeUrl);
};
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const setWebApplicationData = (session: Session, appData: ApplicationData, trans

if (Object.keys(appData[OverseasEntityDueDiligenceKey] as OverseasEntityDueDiligence).length) {
appData[WhoIsRegisteringKey] = WhoIsRegisteringType.SOMEONE_ELSE;
} else if (Object.keys(appData[DueDiligenceKey] as DueDiligence).length){
} else if (Object.keys(appData[DueDiligenceKey] as DueDiligence).length) {
appData[WhoIsRegisteringKey] = WhoIsRegisteringType.AGENT;
}

Expand Down
1 change: 1 addition & 0 deletions src/utils/secure.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const getFilterPage = async (req: Request, res: Response, next: NextFunct
[IsSecureRegisterKey]: appData[IsSecureRegisterKey]
});
}

return res.render(templateName, {
backLinkUrl: backLinkUrl,
templateName: templateName,
Expand Down

0 comments on commit 5c3d9a3

Please sign in to comment.