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

Add messages to Empty responses & Empty List Responses #94

Open
sumit-badsara opened this issue May 24, 2020 · 2 comments
Open

Add messages to Empty responses & Empty List Responses #94

sumit-badsara opened this issue May 24, 2020 · 2 comments
Labels
available No one has claimed the issue (or) is working on it. documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@sumit-badsara
Copy link

sumit-badsara commented May 24, 2020

Describe the bug
For most of the 201_CREATED responses are empty.
We need to respond with atleast a success message that the resource has been created successfully.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'http://localhost:8000/api/users/register/'
  2. Register a new user
  3. See Response

Expected behavior
Return a relevant dictionary to response
Example for above specified endpoint :

{
   "detail":"User has been registered successfully"
}
@sumit-badsara sumit-badsara added available No one has claimed the issue (or) is working on it. documentation Improvements or additions to documentation good first issue Good for newcomers labels May 24, 2020
@naveennvrgup
Copy link
Contributor

naveennvrgup commented May 26, 2020

Also for some list API endpoints, when list is empty, return a response rather than an empty list.

  1. @BadduCoder I have removed this line from the issue description as an empty list is more preferred than a response in the frontend (for this case).
  2. This is because if the response detail is provided we have to check for whether it is array or object etc., Just adding more point of failure.
  3. If the array is empty we will provide an appropriate message in the frontend only. 😇

@sumit-badsara
Copy link
Author

Okay! let's then roll then 🔥

@priyanshisharma priyanshisharma mentioned this issue Jun 21, 2020
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available No one has claimed the issue (or) is working on it. documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants