Skip to content

Address#17

Open
Vamsi-Praveen wants to merge 4 commits intodevfrom
address
Open

Address#17
Vamsi-Praveen wants to merge 4 commits intodevfrom
address

Conversation

@Vamsi-Praveen
Copy link

Done with the address issue

@Vamsi-Praveen Vamsi-Praveen self-assigned this Jul 12, 2024
@Vamsi-Praveen Vamsi-Praveen linked an issue Jul 12, 2024 that may be closed by this pull request
16 tasks
Copy link
Member

@nani-samireddy nani-samireddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good some small changes needed

Comment on lines +169 to +187
if (req.body.isDefault !== undefined) address.isDefault = req.body.isDefault;
if (req.body.name !== undefined) address.name = req.body.name;
if (req.body.email !== undefined) address.contact.email = req.body.email;
if (req.body.phone !== undefined) address.contact.phone = req.body.phone;

if (req.body.doorNo !== undefined) address.address.doorNo = req.body.doorNo;
if (req.body.street !== undefined) address.address.street = req.body.street;
if (req.body.city !== undefined) address.address.city = req.body.city;
if (req.body.state !== undefined) address.address.state = req.body.state;
if (req.body.zip !== undefined) address.address.zip = req.body.zip;
if (req.body.coordinates !== undefined) address.address.location.coordinates = req.body.coordinates;

if (req.body.additionalInstructions !== undefined) {
address.additionalInstructions = req.body.additionalInstructions;
}
if (req.body.additionalInstructions !== undefined) {
address.additionalInstructions = req.body.additionalInstructions;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like more hardcoded way. Can we have a validator in the mongoose model?

import SudoUser from "../Sudouser/sudouser-model";
import jwt, { JwtPayload } from "jsonwebtoken"

export const verifyAuthOrSudo = expressAsyncHandler(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the name to more informative something like allowSudoUserOrVerifiedUser
Try to name them in way that people can easily understand by reading the name

@nani-samireddy
Copy link
Member

@eswarmamidi19 Please review the changes once in this PR and add comments if any changes are required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Address Model and Routes

2 participants