-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dw add acceptance email #78
base: ns-add-conf-email
Are you sure you want to change the base?
Conversation
throw new Error('Error posting application'); | ||
} | ||
const user = await this.userService.getUser(applicationData.userId); | ||
const site = await this.siteService.getSite(applicationData.siteId); |
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.
const site = await this.siteService.getSite(applicationData.siteId); | |
const site = await this.siteService.getSite(applicationData.siteId.N); |
Don't forget the .N to extract the number!
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 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.
I added .N to the userid and siteid from the updateapplication function and that seemed to work because thats the one retrieving from dynamo
if (result.$metadata.httpStatusCode !== 200) { | ||
throw new Error('Error posting application'); | ||
} | ||
const user = await this.userService.getUser(applicationData.userId); |
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.
const user = await this.userService.getUser(applicationData.userId); | |
const user = await this.userService.getUser(applicationData.userId.N); |
Same thing here
data?: { [key: string]: any }, | ||
): UserModel { | ||
const siteIds = data['siteIds'].L.map((item) => Number(item.N)) ?? []; |
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.
const siteIds = data['siteIds'].L.map((item) => Number(item.N)) ?? []; | |
const siteIds = Array.isArray(data["siteIds"]?.L) | |
? data["siteIds"].L.map(item => Number(item.N)) | |
: []; |
You might have to make this change to remove this error: Cannot read properties of undefined (reading 'map')
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 PR seems close to being done! Just a couple things left
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.
Also make sure that the userId of the user is given to the user in the acceptance email as they will be using their userId to register/create their account.
^ screenshot of what the email looks like.