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

Need CRUD and additional endpoints implementation #392

Merged
merged 15 commits into from
Oct 30, 2023
Merged

Conversation

azizamankenova
Copy link
Contributor

Need related endpoints are implemented

Copy link
Contributor

@mehmetkuzu mehmetkuzu left a 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"},

@azizamankenova
Copy link
Contributor Author

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

@mehmetkuzu mehmetkuzu dismissed their stale review October 30, 2023 18:04

Corrected and fine.

Copy link
Contributor

@mehmetkuzu mehmetkuzu left a 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,
Copy link
Contributor

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",
Copy link
Contributor

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"]),
Copy link
Contributor

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
Copy link
Contributor

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

@mehmetkuzu mehmetkuzu merged commit a1c959f into main Oct 30, 2023
@mehmetkuzu mehmetkuzu deleted the BE/Feature/need branch October 31, 2023 07:07
@azizamankenova azizamankenova changed the title Need CRUD implementation Need CRUD and additional endpoints implementation Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants