From 212e83bab3f1f9055f1321c3e934b4f4659250bf Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Fri, 26 Feb 2016 09:55:43 +0100 Subject: Soft delete issuables --- doc/api/issues.md | 44 +++++++++++++++++++++++++++++---- doc/api/merge_requests.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 5 deletions(-) (limited to 'doc/api') diff --git a/doc/api/issues.md b/doc/api/issues.md index 9e704648b25..5df7ce9f006 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -326,17 +326,51 @@ Example response: } ``` -## Delete existing issue (**Deprecated**) +## Delete existing issue -This call is deprecated and returns a `405 Method Not Allowed` error if called. -An issue gets now closed and is done by calling -`PUT /projects/:id/issues/:issue_id` with the parameter `state_event` set to -`close`. See [edit issue](#edit-issue) for more details. +Only for admins. Soft deletes the issue in question. Returns the issue which was deleted. ``` DELETE /projects/:id/issues/:issue_id ``` +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of a project | +| `issue_id` | integer | yes | The ID of a project's issue | + +```bash +curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/4/issues/85 +``` + +Example response: + +```json +{ + "created_at" : "2016-01-07T12:46:01.410Z", + "author" : { + "name" : "Alexandra Bashirian", + "avatar_url" : null, + "username" : "eileen.lowe", + "id" : 18, + "state" : "active", + "web_url" : "https://gitlab.example.com/u/eileen.lowe" + }, + "state" : "closed", + "title" : "Issues with auth", + "project_id" : 4, + "description" : null, + "updated_at" : "2016-01-07T12:55:16.213Z", + "iid" : 15, + "labels" : [ + "bug" + ], + "id" : 85, + "assignee" : null, + "milestone" : null +} +``` + ## Comments on issues Comments are done via the [notes](notes.md) resource. diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 5c527d55481..977e16b8601 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -380,6 +380,68 @@ Parameters: If the operation is successful, 200 and the updated merge request is returned. If an error occurs, an error number and a message explaining the reason is returned. +## Delete a MR + +Soft deletes a merge request. For admins only. + +``` +DELETE /projects/:id/merge_requests/:merge_request_id +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of a project | +| `merge_request_id` | integer | yes | The ID of a project's merge request | + +Example response: + +```json +{ + "id": 1, + "target_branch": "master", + "source_branch": "test1", + "project_id": 3, + "title": "test1", + "state": "merged", + "upvotes": 0, + "downvotes": 0, + "author": { + "id": 1, + "username": "admin", + "email": "admin@example.com", + "name": "Administrator", + "state": "active", + "created_at": "2012-04-29T08:46:00Z" + }, + "assignee": { + "id": 1, + "username": "admin", + "email": "admin@example.com", + "name": "Administrator", + "state": "active", + "created_at": "2012-04-29T08:46:00Z" + }, + "source_project_id": 4, + "target_project_id": 4, + "labels": [ ], + "description":"fixed login page css paddings", + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 4, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" +} +``` + ## Accept MR Merge changes submitted with MR using this API. -- cgit v1.2.1 From 7342a4566cc2eef0e434f3aea0eac48674baaaf1 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 14 Mar 2016 21:46:44 +0100 Subject: Dry destroy action on issuables --- doc/api/issues.md | 2 +- doc/api/merge_requests.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/api') diff --git a/doc/api/issues.md b/doc/api/issues.md index 5df7ce9f006..e2050db06d9 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -328,7 +328,7 @@ Example response: ## Delete existing issue -Only for admins. Soft deletes the issue in question. Returns the issue which was deleted. +Only for admins and project owners. Soft deletes the issue in question. Returns the issue which was deleted. ``` DELETE /projects/:id/issues/:issue_id diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 977e16b8601..499e56c6395 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -382,7 +382,7 @@ If an error occurs, an error number and a message explaining the reason is retur ## Delete a MR -Soft deletes a merge request. For admins only. +Soft deletes a merge request. For admins and owners only. ``` DELETE /projects/:id/merge_requests/:merge_request_id -- cgit v1.2.1 From 3b088fc5b53f03605484ebef1945b8839abe19de Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 21 Mar 2016 14:12:52 +0100 Subject: Minor improvements on IssuableActions --- doc/api/issues.md | 34 ++++------------------------ doc/api/merge_requests.md | 56 ++++++----------------------------------------- 2 files changed, 11 insertions(+), 79 deletions(-) (limited to 'doc/api') diff --git a/doc/api/issues.md b/doc/api/issues.md index e2050db06d9..013ad9ffaa2 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -326,9 +326,11 @@ Example response: } ``` -## Delete existing issue +## Delete an issue -Only for admins and project owners. Soft deletes the issue in question. Returns the issue which was deleted. +Only for admins and project owners. Soft deletes the issue in question. +If the operation is successful, a status code of `200` is returned. Any the case you cannot +destroy this issue, or it is not present, code `404` is given. ``` DELETE /projects/:id/issues/:issue_id @@ -343,34 +345,6 @@ DELETE /projects/:id/issues/:issue_id curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/4/issues/85 ``` -Example response: - -```json -{ - "created_at" : "2016-01-07T12:46:01.410Z", - "author" : { - "name" : "Alexandra Bashirian", - "avatar_url" : null, - "username" : "eileen.lowe", - "id" : 18, - "state" : "active", - "web_url" : "https://gitlab.example.com/u/eileen.lowe" - }, - "state" : "closed", - "title" : "Issues with auth", - "project_id" : 4, - "description" : null, - "updated_at" : "2016-01-07T12:55:16.213Z", - "iid" : 15, - "labels" : [ - "bug" - ], - "id" : 85, - "assignee" : null, - "milestone" : null -} -``` - ## Comments on issues Comments are done via the [notes](notes.md) resource. diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 499e56c6395..88c3d251404 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -380,9 +380,12 @@ Parameters: If the operation is successful, 200 and the updated merge request is returned. If an error occurs, an error number and a message explaining the reason is returned. -## Delete a MR +## Delete a merge request + +Only for admins and project owners. Soft deletes the merge request in question. +If the operation is successful, a status code of `200` is returned. Any the case you cannot +destroy this merge request, or it is not present, code `404` is given. -Soft deletes a merge request. For admins and owners only. ``` DELETE /projects/:id/merge_requests/:merge_request_id @@ -393,53 +396,8 @@ DELETE /projects/:id/merge_requests/:merge_request_id | `id` | integer | yes | The ID of a project | | `merge_request_id` | integer | yes | The ID of a project's merge request | -Example response: - -```json -{ - "id": 1, - "target_branch": "master", - "source_branch": "test1", - "project_id": 3, - "title": "test1", - "state": "merged", - "upvotes": 0, - "downvotes": 0, - "author": { - "id": 1, - "username": "admin", - "email": "admin@example.com", - "name": "Administrator", - "state": "active", - "created_at": "2012-04-29T08:46:00Z" - }, - "assignee": { - "id": 1, - "username": "admin", - "email": "admin@example.com", - "name": "Administrator", - "state": "active", - "created_at": "2012-04-29T08:46:00Z" - }, - "source_project_id": 4, - "target_project_id": 4, - "labels": [ ], - "description":"fixed login page css paddings", - "work_in_progress": false, - "milestone": { - "id": 5, - "iid": 1, - "project_id": 4, - "title": "v2.0", - "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", - "state": "closed", - "created_at": "2015-02-02T19:49:26.013Z", - "updated_at": "2015-02-02T19:49:26.013Z", - "due_date": null - }, - "merge_when_build_succeeds": true, - "merge_status": "can_be_merged" -} +```bash +curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/4/merge_request/85 ``` ## Accept MR -- cgit v1.2.1 From d28a587e82836d28524339586e1b6c1546a4bff5 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 21 Mar 2016 17:12:03 +0100 Subject: Fix typos and denting --- doc/api/issues.md | 2 +- doc/api/merge_requests.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/api') diff --git a/doc/api/issues.md b/doc/api/issues.md index 013ad9ffaa2..18d64c41986 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -329,7 +329,7 @@ Example response: ## Delete an issue Only for admins and project owners. Soft deletes the issue in question. -If the operation is successful, a status code of `200` is returned. Any the case you cannot +If the operation is successful, a status code `200` is returned. In case you cannot destroy this issue, or it is not present, code `404` is given. ``` diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 88c3d251404..b20a6300b7a 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -383,10 +383,9 @@ If an error occurs, an error number and a message explaining the reason is retur ## Delete a merge request Only for admins and project owners. Soft deletes the merge request in question. -If the operation is successful, a status code of `200` is returned. Any the case you cannot +If the operation is successful, a status code `200` is returned. In case you cannot destroy this merge request, or it is not present, code `404` is given. - ``` DELETE /projects/:id/merge_requests/:merge_request_id ``` -- cgit v1.2.1