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

Update routes #12

Merged
merged 3 commits into from
Dec 26, 2020
Merged

Update routes #12

merged 3 commits into from
Dec 26, 2020

Conversation

arnabsen1729
Copy link
Collaborator

Fixed: #7 #11
Partially Fixes: #6
Link to org repo issue: dsc-x/omg-frames#2

Changes Made

1. User model updated

New fields 'Role' and 'Organisation' are added to the user model. So the request body for register has to be changed accordingly. The new request body is

{
  "email": "string",
  "name": "string",
  "organisation": "string",
  "password": "string",
  "role": "string"
}

2. REST Conventions

Keeping the REST conventions in mind, some changes were made:

  • Status is removed as a field from all the responses. Cause status code conveys the information.
  • Whenever a new object is created the object is sent as a response.

So right now when the login request is successful the response contains:

  • token
  • user data (i.e name, email, role, organisation .etc)

Also, when a POST request is made to /frames it returns

  • frame_id
  • frame_data

3. Delete frame method added

A new method DELETE is added. It requires an id as a query, also the API-key should be provided in the header.
e.g.

DELETE /frames?id=MPTVwXCVxVS2M4hOZ07

4. APIDocs were updated with these changes

Files changed

app/db.py
app/routes.py
docs/deleteframes.yml
docs/register.yml

@arnabsen1729 arnabsen1729 merged commit 9f0e4f7 into master Dec 26, 2020
@arnabsen1729 arnabsen1729 mentioned this pull request Dec 26, 2020
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.

"Role" and "Organisation" fields to be added REST conventions need to be followed
1 participant