-
Notifications
You must be signed in to change notification settings - Fork 2
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
Need CRUD and additional endpoints implementation #392
Conversation
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.
The projection causes an error in need service:
projection = {
"$toString": "$_id",
"created_by": 1,
"urgency": 1,
"initialQuantity": 1,
"unsuppliedQuantity": 1,
"type": 1,
"details": 1,
}
I propose the following use:
"_id": {"$toString": "$_id"},
Thank you for the review, I'll fix it |
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.
All are fine. Working.
|
||
def create_need(need: Need) -> str: | ||
# Manual validation for required fields during creation | ||
if not all([need._id, need.created_by, need.urgency, |
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.
Actually this does not effect. As it is None. So the current code is ok with that.
|
||
def get_needs(need_id:str = None) -> list[dict]: | ||
projection = { | ||
"$toString": "$_id", |
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 gives error. You can change it with
"_id": {"$toString": "$_id"},
# needs_data = needs_collection.find() | ||
|
||
# return [{ | ||
# "_id": str(need_data["_id"]), |
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.
Again
"_id": {"$toString": "$_id"},
@@ -4,7 +4,8 @@ | |||
from Services import resource_service | |||
from Services.build_API_returns import * | |||
|
|||
from Controllers import resource_controller, user_controller, uprofile_optinfo_controller, uprofile_languages_controller | |||
|
|||
from Controllers import resource_controller, user_controller, uprofile_optinfo_controller, uprofile_languages_controller, user_profile_controller, need_controller |
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.
Would you remove the user_profile_controller
We changed the name but possibly mixed
Need related endpoints are implemented