Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
[ACS-4331] Add deleteTag method to tags API (#1490)
Browse files Browse the repository at this point in the history
* ACS-4331 - created new method for deleting a tag

* ACS-4331 - added some documentation for deleteTag

* ACS-4331 - added docs

* ACS-4331 - README formating fix

* [ACS-4331] changed Promise type to void

* [ACS-4331] corrected link
  • Loading branch information
nikita-web-ua committed Feb 14, 2023
1 parent 1d0d500 commit 4152c12
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/content-rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ TagsApi | [**getTag**](docs/TagsApi.md#getTag) | **GET** /tags/{tagId} | Get a t
TagsApi | [**listTags**](docs/TagsApi.md#listTags) | **GET** /tags | List tags
TagsApi | [**listTagsForNode**](docs/TagsApi.md#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node
TagsApi | [**updateTag**](docs/TagsApi.md#updateTag) | **PUT** /tags/{tagId} | Update a tag
TagsApi | [**deleteTag**](docs/TagsApi.md#deleteTag) | **DELETE** /tags/{tagId} | Delete a tag
TagsApi | [**createTags**](docs/TagsApi.md#createTags) | **POST** /tags/ | Create specified by **tags** list of tags.
TrashcanApi | [**deleteDeletedNode**](docs/TrashcanApi.md#deleteDeletedNode) | **DELETE** /deleted-nodes/{nodeId} | Permanently delete a deleted node
TrashcanApi | [**getArchivedNodeRendition**](docs/TrashcanApi.md#getArchivedNodeRendition) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node
Expand Down Expand Up @@ -333,4 +334,4 @@ VersionsApi | [**revertVersion**](docs/VersionsApi.md#revertVersion) | **POST**
- [VersionPagingList](docs/VersionPagingList.md)
- [DeletedNode](docs/DeletedNode.md)
- [NodeAssociation](docs/NodeAssociation.md)
- [NodeChildAssociation](docs/NodeChildAssociation.md)
- [NodeChildAssociation](docs/NodeChildAssociation.md)
35 changes: 35 additions & 0 deletions src/api/content-rest-api/api/tags.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,41 @@ parameter are returned in addition to those specified in the **fields** paramete
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts , TagEntry);
}
/**
* Delete a tag
*
* Deletes a tag by **tagId**. This will cause the tag to be removed from all nodes.
*
* @param tagId The identifier of a tag.
* @return Promise<{}>
*/
deleteTag(tagId: string): Promise<void> {

throwIfNotDefined(tagId, 'tagId');

const postBody: null = null;

const pathParams = {
'tagId': tagId
};

const queryParams = {
};

const headerParams = {

};
const formParams = {
};

const contentTypes = ['application/json'];
const accepts = ['application/json'];

return this.apiClient.callApi(
'/tags/{tagId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts);
}

/**
* Create tags
Expand Down
37 changes: 37 additions & 0 deletions src/api/content-rest-api/docs/TagsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Method | HTTP request | Description
[**listTags**](TagsApi.md#listTags) | **GET** /tags | List tags
[**listTagsForNode**](TagsApi.md#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node
[**updateTag**](TagsApi.md#updateTag) | **PUT** /tags/{tagId} | Update a tag
[**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /tags/{tagId} | Completely deletes a tag
[**createTags**](TagsApi.md#createTags) | **POST** /tags | Create list of tags


Expand Down Expand Up @@ -484,3 +485,39 @@ Name | Type | Description | Notes

[**TagEntry[]**](TagEntry.md)

<a name="deleteTag"></a>
## deleteTag
> deleteTag(tagId)
Deletes the tag with **tagId**. This will cause the tag to be removed from all nodes.

You must have admin rights to delete a tag.

### Example

```javascript
import { AlfrescoApi, TagsApi} from '@alfresco/js-api';

const alfrescoApi = new AlfrescoApi({
hostEcm: 'http://127.0.0.1:8080'
});

const tagsApi = new TagsApi(alfrescoApi);


tagsApi.deleteTag(tagId).then(() => {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tagId** | **string**| The identifier of a tag. |

### Return type

null (empty response body)

0 comments on commit 4152c12

Please sign in to comment.