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
Post request #22
Post request #22
Conversation
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n \"title\":\"Wie Traurig\",\n \"message\":\"Ich habe meinen Freund im Denver verloren und jetzt bin Ich ganz allein :(\",\n \"name\":\"Till Lindemann\",\n \"latitude\":125.456892,\n \"longitude\":-18.982791\n}", |
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.
Sprichst du deutsch...? I'll be your new friend :)
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.
Nur ein bisschen.. leide habe Ich viel vergessen 😅
" pm.expect(attributes['latitude']).not.to.be.null;", | ||
" pm.expect(attributes['longitude']).not.to.be.null;", | ||
" pm.expect(attributes['message']).not.to.be.null;", | ||
" pm.expect(attributes['name']).not.to.be.null;", |
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.
Should name be included in the post? Just want to clarify so we are sending the correct info to the POST
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.
Also - is this a required field or is it a field where if the user does not fill it out it will send to the server as anonymous?
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 latter - it is optional and defaults to Anonymous if not provided
" pm.expect(attributes['name']).not.to.be.null;", | ||
" pm.expect(attributes['title']).not.to.be.null;", | ||
" pm.expect(attributes['location']).not.to.be.null;", | ||
"});" |
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.
Right now the Object we are sending
looks like
const newStory = {title, message, latitude, longitude}
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.
Thank you for getting this going! 🚀
I commented about the object you need for the post request, but it looks like you have already addressed it in slack!
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.
Really excellent work here, sir!
Possibility to revisit in future in case we want JSON response to conform to JSON 1.0 Spec |
Changes Implemented:
api.urls.py
to dry up logic (keepapi/v1
namespacing within Django project root vs app module)api.views.py
to useClass-based views
(vsFunction-based views
in prior implementation)Postman
suite to test the implementation of the following:/api/v1/stories
(index of all stories, note, still more work to be done here once geoloc API is integrated)/api/v1/stories/<id:pk>
(retrieve an individual story)/api/v1/stories
(create a new story)/api/v1/stories/<id:pk>
(delete an individual story)Dev
andProd
into postman dir, so you can import both and toggle between the two, for future testing phasesPostman
collection (if any changes made to endpoints that could break tests as currently written).Quality Control Checklist:
Blockers (if applicable): None, but a special thank you to the
Django
docs for the incorrect tutorial on how to build routes!! 🤦🏽♂️Next Steps & Additional Notes:
PATCH
/PUT
endpoint to update a storypytest
request specs (if they exist). Admittedly, have done zero research on this, and have just been using Postman to get our endpoints tested and deployed as quickly as possible for the FE team.