Skip to content
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

[Feat]: [Add Validation for Activity] #432

Open
TejasNair9977 opened this issue Oct 29, 2023 · 11 comments
Open

[Feat]: [Add Validation for Activity] #432

TejasNair9977 opened this issue Oct 29, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers Issue Size: 3 Something that has reference but needs a lot of change Priority: High Needs to be done ASAP
Milestone

Comments

@TejasNair9977
Copy link
Member

Description

There needs to be validation for all IDs in here. The validation must be done in the controller. You need to provide the service with a proper filter so that it can check if the ID provided in req.body actually exists for each collection that it belongs to. For example,
In req.body for adding Activity, it needs to check that the provided IDs actually exist in the database. As always, never trust that the user is providing valid data.

Use Case

It will make sure that data given by the user to the database is valid.

Proposed Solution

Right before the function that creates the document, check if the IDs provided by the user is valid.

@TejasNair9977 TejasNair9977 added enhancement New feature or request Issue Size: 3 Something that has reference but needs a lot of change Priority: Medium Something slightly urgent to work on hacktoberfest labels Oct 29, 2023
@TejasNair9977 TejasNair9977 added this to the Refinement milestone Oct 29, 2023
@TejasNair9977 TejasNair9977 added good first issue Good for newcomers Priority: High Needs to be done ASAP and removed Priority: Medium Something slightly urgent to work on labels Oct 29, 2023
@churrundo
Copy link

Hi there. This would actually be my first ever contribution. I'll go ahead as instructed on the readme if that's ok

@churrundo
Copy link

Aaand I just found the contribution guidelines and the instruction to not start working until being assigned the issue... 😳

I haven't actually touched anything. I've been doing the installations and setting up the environment. I'll wait for a green light to continue

@TejasNair9977
Copy link
Member Author

ah sorry for being late @churrundo . you can go ahead anytime, i have assigned this issue to you. thank you for taking interest in this project!

@churrundo
Copy link

Thanks!

@TejasNair9977
Copy link
Member Author

@churrundo the testcases for Activity might act up after you make your changes, so just like add data into your DB with the same IDs as in the testcase files through compass or atlas, wherever you code on, like so
image
and after that ig you should be fine.

@churrundo
Copy link

Perfect, thank you

@TejasNair9977 TejasNair9977 moved this to In Progress in Backend Team Oct 29, 2023
@TejasNair9977
Copy link
Member Author

@churrundo I'd recommend you to sync your branch and have a look at the new middleware. I'm sure itll make this issue a lot easier to solve!

@churrundo
Copy link

Ok... So it just needs to count the amount of id's?

@TejasNair9977
Copy link
Member Author

effectively yeah @churrundo

@churrundo
Copy link

Lmao. That's so much simpler

@hricha11
Copy link
Contributor

plz assign this issue to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Issue Size: 3 Something that has reference but needs a lot of change Priority: High Needs to be done ASAP
Projects
Status: In Progress
Development

No branches or pull requests

3 participants