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
default, server_default and creating new invitation #44
Conversation
…l row you need to add default &server_default to the models.py in order for the sqlalchemy to expect the values to be inserted, also i created the restapi for creating a new order
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 has been some changes introduced by @inbarbarkai, I want to make sure we're not conflicting, can you please take a look at hist branch and consult him about this?
Lets merge mine and see, it shouldn't contain too much conflicts if any. |
@router.get("/invite", summary="Creates a new invitation for this user.") | ||
def create_invitation(invitations: InvitationRepository = Depends(create_invitations_list), user_id: str = None, invitees_amount: int = None, invitees_arrival_timestamp_epoch: int = None,comment_for_guard: str = None): | ||
new_invitation = Invitation( |
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.
Do some data validations
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.
Why are you using get to create new invite?
Use post or put.
Also, prefably, don't use query parameters for input.
Use the body
@router.get("/invite", summary="Creates a new invitation for this user.") | ||
def create_invitation(invitations: InvitationRepository = Depends(create_invitations_list), user_id: str = None, invitees_amount: int = None, invitees_arrival_timestamp_epoch: int = None,comment_for_guard: str = None): | ||
new_invitation = Invitation( |
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.
Why are you using get to create new invite?
Use post or put.
Also, prefably, don't use query parameters for input.
Use the body
@inbarbarkai I'm guessing it's no longer relevant, am I correct? |
@yarons I don't know... That is for @KamiTzayig to decide |
@KamiTzayig we should rebase your changes, some of them are required for your UI work. |
Conflicting, irrelevant, reopen if necessary. |
in order for the default values to be inserted from the db when creating a new sql row you need to add default &server_default to the models.py so sqlalchemy can expect the values to be inserted, also i created the restapi for creating a new order