-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address bug issue #213
base: main
Are you sure you want to change the base?
Address bug issue #213
Conversation
CI: No security warnings found |
|
||
} | ||
const selectPremise = req.body.correspondenceAddress; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this const be called as correspondenceAddress instead of premise?
|
||
} | ||
const selectPremise = req.body.correspondenceAddress; | ||
CorrespondenceAddressDetailsService.saveCorrespondenceDetailsAddress(req, acspData, selectPremise); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have to create an object of the service class first and then call the function?
const { firstName, lastName, addresses } = acspData; | ||
|
||
/* const acspData : ACSPData = session?.getExtraData(USER_DATA)!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commented out code can be removed.
throw new Error("Method not implemented."); | ||
} | ||
|
||
static saveCorrespondenceAddressToSession (session: Session, req: Request, ukAddresses: UKAddress[], inputPremise: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to create static methods.
CI: No security warnings found |
saveDataInSession(req, USER_DATA, acspData); | ||
res.redirect(BASE_URL + SOLE_TRADER_CORRESPONDENCE_ADDRESS_CONFIRM); | ||
const autoLookupSessionservice = new CorrespondenceAddressAutoLookService(); | ||
autoLookupSessionservice.saveCorrespondenceAddressToSession(acspData, req, ukAddresses, correspondencePremise); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saveCorrespondenceAddress is enough no need to add "ToSession" in the name
saveDataInSession(req, USER_DATA, acspData); | ||
res.redirect(BASE_URL + SOLE_TRADER_CORRESPONDENCE_ADDRESS_CONFIRM); | ||
const AddressManualservice = new CorrespondenceAddressManualService(); | ||
AddressManualservice.saveCorrespondenceManualAddress(req, acspData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable name needs to follow camel casing
CI: No security warnings found |
CI: No security warnings found |
2 similar comments
CI: No security warnings found |
CI: No security warnings found |
country: getCountryFromKey(ukAddress.country), | ||
postcode: ukAddress.postcode | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can break out of the loop once the match is found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no difference between address and correspondenceAddress. Only one can be used
CI: No security warnings found |
if (ukAddress.premise === inputPremise) { | ||
const correspondenceAddress: Address = { | ||
propertyDetails: ukAddress.premise, | ||
// premise: ukAddress.premise, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this commented code.
export class CorrespondenceAddressAutoLookService { | ||
saveCorrespondenceAddress (acspData :ACSPData, ukAddresses: UKAddress[], inputPremise: string): ACSPData { | ||
|
||
const address = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this anymore?
CI: No security warnings found |
CI: No security warnings found |
-fix address bug (save session and carry over)
-added service layers