[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:
Adam Świderski
2024-11-07 09:05:32 +01:00
committed by GitHub
parent 64e3419f25
commit 8d78a408b1
3 changed files with 29 additions and 24 deletions

View File

@@ -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);
}
}
}