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

Delete organization by id endpoint #11

Open
8ivek opened this issue Feb 16, 2020 · 0 comments
Open

Delete organization by id endpoint #11

8ivek opened this issue Feb 16, 2020 · 0 comments
Assignees
Labels
story A new feature that has been prioritized

Comments

@8ivek
Copy link
Member

8ivek commented Feb 16, 2020

User Story
We need an endpoint v1/organizations/:id which deletes an existing organization from the organization array.

We have an organizations array in server.js file

const organizations = []

If you have any questions about this issue please slack in (#proj-unitednepali) or comment here.
https://nepalcodes.slack.com/archives/CT5S2H74G

endpoint: v1/organizations/:id
example: v1/organizations/1 (here 1 = id which gets deleted)
method: DELETE
input: none

response format:

{
	"success": 1,
	"timestamp": "2020-02-16T14:02-0400"
}

and the error format:

{
	"success": 0,
	"timestamp": "2020-02-16T14:02-0400",
	"error": "message"
}

note: you need to execute this using rest-client postman.

Acceptance Criteria
When querying v1/organizations (using GET method) from rest client (or browser) it should return all the organization as an array in JSON format but the deleted organization.

Test
Create a test (inside the cypress folder) and make sure the endpoint returns the expected response as above. Also, check if the record is deleted by querying organization/getall endpoint

@8ivek 8ivek added the story A new feature that has been prioritized label Feb 16, 2020
@christikaes christikaes added this to the API runs locally milestone Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
story A new feature that has been prioritized
Projects
None yet
Development

No branches or pull requests

3 participants