mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-8981] [E2E] added deleteTagsByTagName method for TagsApiin ACA (#4226)
* [ACS-8981] [E2E] added deleteTagsByTagName method for TagsApiin ACA * [ACS-8981] fixed C698515
This commit is contained in:
@@ -56,9 +56,11 @@ export class TagsApi {
|
||||
}
|
||||
}
|
||||
|
||||
async deleteTag(tagId: string): Promise<void> {
|
||||
async deleteTags(tagIds: string[]): Promise<void> {
|
||||
try {
|
||||
return this.apiService.tagsApi.deleteTag(tagId);
|
||||
for (const tagId of tagIds) {
|
||||
await this.apiService.tagsApi.deleteTag(tagId);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
@@ -72,4 +74,23 @@ export class TagsApi {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async listTags(params?: { tag?: string; matching?: boolean }): Promise<TagPaging> {
|
||||
try {
|
||||
return this.apiService.tagsApi.listTags(params);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async deleteTagsByTagName(tagName: string): Promise<void> {
|
||||
try {
|
||||
const response = await this.listTags({ tag: tagName, matching: true });
|
||||
const tagIds = response.list.entries.map((entry) => entry.entry.id);
|
||||
await this.deleteTags(tagIds);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user