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

[Backend] General fixes #338 #344

Merged
merged 4 commits into from
Nov 28, 2022

Conversation

mehmetemreakbulut
Copy link
Contributor

Description:
Fundamental structure of APIs is built, however, we have to add new fields or configs to align with frontend and mobile. Some fixes we determined listed below.

Tasks Done:

  • Add location to Post
  • Fix pagination in 'user's post' and 'user's articles' endoint.
  • Add image upload to posts and articles.
  • Comment CRUD Operations
  • Author info added to get_post and get_article endpoints
  • Missing response data fields FE and mobile team demanded were added.

Reviewer:
@oguzhandemirelx

Notes:

  • File url conventions:
    • Article: article/{article.id}/{image.id}.jpg
    • Post: post/{post.id}/{image.id}.jpg
    • Comment: comment/{comment.id}/{image.id}.jpg
    • Doctor Document: document/{account.id}/{filename}{extension}
  • For location in posts and comment: longitude:float and latitude:float
  • Pagination fixed. Backend Team must use paginator we have developed.
  • Documentation is updated. You can find new doc here

Run in Postman

Issue:

@mehmetemreakbulut mehmetemreakbulut added Type: Bug Something isn't working Prio: High Importance of Issue: High Type: To Do Our tasks are labeled with this label. Type: Enhancement New features via code and/or design. Status: In Progress Issue is worked on, currently Team: Backend Backend based work - for backend team labels Nov 28, 2022
@mehmetemreakbulut mehmetemreakbulut self-assigned this Nov 28, 2022
@mehmetemreakbulut
Copy link
Contributor Author

  • I have added voting info of user for posts and comment when get_post endpoint is used

Copy link
Contributor

@oguzhandemirelx oguzhandemirelx left a comment

Choose a reason for hiding this comment

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

Nice work @mehmetemreakbulut. Your improvements which is mentioned in Issue 338 are okay. Uploading images to S3 works correctly. It makes sense to add new database tables. On the Comment object, CRUD operations function properly. I am merging this PR.

@oguzhandemirelx oguzhandemirelx merged commit 9b0a94f into master Nov 28, 2022
doctor_data = {}
full_name = f"{request.data['firstname']} {request.data['lastname']}"
doctor_data['full_name'] = full_name
doctor_data['specialization']= Category.objects.get(name=request.data['branch']).id
doctor_data['user'] = account.id
doctor_serializer = DoctorSerializer(data=doctor_data)
if doctor_serializer.is_valid():
doctor_serializer.save()
doctor = doctor_serializer.save()
print(request.FILES)
Copy link
Contributor

@canberkboun9 canberkboun9 Dec 1, 2022

Choose a reason for hiding this comment

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

should this print statement deleted?

print(request.FILES)
if len(request.FILES) > 0:
for filename, file in request.FILES.items():
print(filename)
Copy link
Contributor

Choose a reason for hiding this comment

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

and this

@palahb palahb added Status: Need Review Issue work is done, waiting to be reviewed Status: Accepted Issue is reviewed, accepted and removed Status: In Progress Issue is worked on, currently Status: Need Review Issue work is done, waiting to be reviewed labels Dec 6, 2022
@mehmetemreakbulut mehmetemreakbulut changed the title Backend/feature/general fixes #338 [Backend] General fixes #338 Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio: High Importance of Issue: High Status: Accepted Issue is reviewed, accepted Team: Backend Backend based work - for backend team Type: Bug Something isn't working Type: Enhancement New features via code and/or design. Type: To Do Our tasks are labeled with this label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants